Changeset 23453 in vbox for trunk/src/VBox/VMM/PGMPhys.cpp
- Timestamp:
- Sep 30, 2009 9:55:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMPhys.cpp
r23443 r23453 1168 1168 { 1169 1169 void *pvPage; 1170 PPGMPAGEMAP pMapIgnored; 1171 rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT), &pMapIgnored, &pvPage); 1170 rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT), &pvPage); 1172 1171 AssertLogRelRCReturn(rc, rc); 1173 1172 ASMMemZeroPage(pvPage); … … 2329 2328 { 2330 2329 void *pvDstPage; 2331 PPGMPAGEMAP pMapIgnored; 2332 rc = pgmPhysPageMap(pVM, pRamPage, GCPhys + (iPage << PAGE_SHIFT), &pMapIgnored, &pvDstPage); 2330 rc = pgmPhysPageMap(pVM, pRamPage, GCPhys + (iPage << PAGE_SHIFT), &pvDstPage); 2333 2331 if (RT_FAILURE(rc)) 2334 2332 { … … 2483 2481 int rc = pgmLock(pVM); 2484 2482 AssertRC(rc); 2483 2485 2484 PPGMPAGE pShadowPage = &pRomPage->Shadow; 2486 2485 if (!PGMROMPROT_IS_ROM(pRomPage->enmProt)) … … 2490 2489 } 2491 2490 2492 pRomPage->LiveSave.fWrittenTo = true; 2493 if (RT_UNLIKELY(PGM_PAGE_GET_STATE(pShadowPage) != PGM_PAGE_STATE_ALLOCATED)) 2491 void *pvDstPage; 2492 rc = pgmPhysPageMakeWritableAndMap(pVM, pShadowPage, GCPhys & X86_PTE_PG_MASK, &pvDstPage); 2493 if (RT_SUCCESS(rc)) 2494 2494 { 2495 rc = pgmPhysPageMakeWritable(pVM, pShadowPage, GCPhys); 2496 if (RT_FAILURE(rc)) 2497 { 2498 pgmUnlock(pVM); 2499 return rc; 2500 } 2501 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* returned */, ("%Rrc\n", rc)); 2495 memcpy((uint8_t *)pvDstPage + (GCPhys & PAGE_OFFSET_MASK), pvBuf, cbBuf); 2496 pRomPage->LiveSave.fWrittenTo = true; 2502 2497 } 2503 2504 void *pvDstPage;2505 PPGMPAGEMAP pMapIgnored;2506 int rc2 = pgmPhysPageMap(pVM, pShadowPage, GCPhys & X86_PTE_PG_MASK, &pMapIgnored, &pvDstPage);2507 if (RT_SUCCESS(rc2))2508 memcpy((uint8_t *)pvDstPage + (GCPhys & PAGE_OFFSET_MASK), pvBuf, cbBuf);2509 else2510 rc = rc2;2511 2498 2512 2499 pgmUnlock(pVM); … … 2582 2569 { 2583 2570 Assert(PGM_PAGE_GET_STATE(&pRom->aPages[iPage].Shadow) != PGM_PAGE_STATE_ZERO); 2584 2571 void *pvDstPage; 2585 2572 const RTGCPHYS GCPhys = pRom->GCPhys + (iPage << PAGE_SHIFT); 2586 rc = pgmPhysPageMakeWritable(pVM, &pRom->aPages[iPage].Shadow, GCPhys); 2587 if (RT_FAILURE(rc)) 2588 break; 2589 2590 void *pvDstPage; 2591 PPGMPAGEMAP pMapIgnored; 2592 rc = pgmPhysPageMap(pVM, &pRom->aPages[iPage].Shadow, GCPhys, &pMapIgnored, &pvDstPage); 2573 rc = pgmPhysPageMakeWritableAndMap(pVM, &pRom->aPages[iPage].Shadow, GCPhys, &pvDstPage); 2593 2574 if (RT_FAILURE(rc)) 2594 2575 break; … … 2609 2590 { 2610 2591 const RTGCPHYS GCPhys = pRom->GCPhys + (iPage << PAGE_SHIFT); 2611 PPGMPAGEMAP pMapIgnored; 2612 void *pvDstPage; 2613 int rc = pgmPhysPageMap(pVM, &pRom->aPages[iPage].Virgin, GCPhys, &pMapIgnored, &pvDstPage); 2592 void const *pvDstPage; 2593 int rc = pgmPhysPageMapReadOnly(pVM, &pRom->aPages[iPage].Virgin, GCPhys, &pvDstPage); 2614 2594 if (RT_FAILURE(rc)) 2615 2595 break;
Note:
See TracChangeset
for help on using the changeset viewer.