process.cc (14022:a7cdc33dab35) | process.cc (14024:abe47b13653d) |
---|---|
1/* 2 * Copyright (c) 2014-2016 Advanced Micro Devices, Inc. 3 * Copyright (c) 2012 ARM Limited 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 148 unchanged lines hidden (view full) --- 157 /** 158 * Share the process memory address space between the new process 159 * and the old process. Changes in one will be visible in the other 160 * due to the pointer use. 161 */ 162 delete np->pTable; 163 np->pTable = pTable; 164 auto &proxy = dynamic_cast<SETranslatingPortProxy &>( | 1/* 2 * Copyright (c) 2014-2016 Advanced Micro Devices, Inc. 3 * Copyright (c) 2012 ARM Limited 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 148 unchanged lines hidden (view full) --- 157 /** 158 * Share the process memory address space between the new process 159 * and the old process. Changes in one will be visible in the other 160 * due to the pointer use. 161 */ 162 delete np->pTable; 163 np->pTable = pTable; 164 auto &proxy = dynamic_cast<SETranslatingPortProxy &>( |
165 ntc->getMemProxy()); | 165 ntc->getVirtProxy()); |
166 proxy.setPageTable(np->pTable); 167 168 np->memState = memState; 169 } else { 170 /** 171 * Duplicate the process memory address space. The state needs to be 172 * copied over (rather than using pointers to share everything). 173 */ --- 132 unchanged lines hidden (view full) --- 306Process::replicatePage(Addr vaddr, Addr new_paddr, ThreadContext *old_tc, 307 ThreadContext *new_tc, bool allocate_page) 308{ 309 if (allocate_page) 310 new_paddr = system->allocPhysPages(1); 311 312 // Read from old physical page. 313 uint8_t *buf_p = new uint8_t[PageBytes]; | 166 proxy.setPageTable(np->pTable); 167 168 np->memState = memState; 169 } else { 170 /** 171 * Duplicate the process memory address space. The state needs to be 172 * copied over (rather than using pointers to share everything). 173 */ --- 132 unchanged lines hidden (view full) --- 306Process::replicatePage(Addr vaddr, Addr new_paddr, ThreadContext *old_tc, 307 ThreadContext *new_tc, bool allocate_page) 308{ 309 if (allocate_page) 310 new_paddr = system->allocPhysPages(1); 311 312 // Read from old physical page. 313 uint8_t *buf_p = new uint8_t[PageBytes]; |
314 old_tc->getMemProxy().readBlob(vaddr, buf_p, PageBytes); | 314 old_tc->getVirtProxy().readBlob(vaddr, buf_p, PageBytes); |
315 316 // Create new mapping in process address space by clobbering existing 317 // mapping (if any existed) and then write to the new physical page. 318 bool clobber = true; 319 pTable->map(vaddr, new_paddr, PageBytes, clobber); | 315 316 // Create new mapping in process address space by clobbering existing 317 // mapping (if any existed) and then write to the new physical page. 318 bool clobber = true; 319 pTable->map(vaddr, new_paddr, PageBytes, clobber); |
320 new_tc->getMemProxy().writeBlob(vaddr, buf_p, PageBytes); | 320 new_tc->getVirtProxy().writeBlob(vaddr, buf_p, PageBytes); |
321 delete[] buf_p; 322} 323 324bool 325Process::fixupStackFault(Addr vaddr) 326{ 327 Addr stack_min = memState->getStackMin(); 328 Addr stack_base = memState->getStackBase(); --- 219 unchanged lines hidden --- | 321 delete[] buf_p; 322} 323 324bool 325Process::fixupStackFault(Addr vaddr) 326{ 327 Addr stack_min = memState->getStackMin(); 328 Addr stack_base = memState->getStackBase(); --- 219 unchanged lines hidden --- |