vbox的更動 838 路徑 trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
- 時間撮記:
- 2007-2-12 下午12:05:52 (18 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r28 r838 170 170 * @returns VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS if it's not a valid 171 171 * GC physical address. 172 * @returns VERR_PGM_GCPHYS_RANGE_CROSSES_BOUNDARY if the range crosses 173 * a dynamic ram chunk boundary 172 174 * @param pVM The VM handle. 173 175 * @param GCPhys The GC physical address to convert. 176 * @param cbRange Physical range 174 177 * @param pHCPtr Where to store the HC pointer on success. 175 178 */ 176 PGMDECL(int) PGMPhysGCPhys2HCPtr(PVM pVM, RTGCPHYS GCPhys, PRTHCPTR pHCPtr) 177 { 179 PGMDECL(int) PGMPhysGCPhys2HCPtr(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange, PRTHCPTR pHCPtr) 180 { 181 #ifdef PGM_DYNAMIC_RAM_ALLOC 182 if ((GCPhys & PGM_DYNAMIC_CHUNK_BASE_MASK) != ((GCPhys+cbRange) & PGM_DYNAMIC_CHUNK_BASE_MASK)) 183 { 184 AssertMsgFailed(("PGMPhysGCPhys2HCPtr %VGp - %VGp crosses a chunk boundary!!\n", GCPhys, GCPhys+cbRange)); 185 return VERR_PGM_GCPHYS_RANGE_CROSSES_BOUNDARY; 186 } 187 #endif 188 178 189 for (PPGMRAMRANGE pRam = CTXSUFF(pVM->pgm.s.pRamRanges); 179 190 pRam; … … 526 537 int rc = PGM_GST_PFN(GetPage,pVM)(pVM, (RTGCUINTPTR)GCPtr, NULL, &GCPhys); 527 538 if (VBOX_SUCCESS(rc)) 528 rc = PGMPhysGCPhys2HCPtr(pVM, GCPhys | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), pHCPtr);539 rc = PGMPhysGCPhys2HCPtr(pVM, GCPhys | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), 1 /* we always stay within on page */, pHCPtr); 529 540 /** @todo real mode & protected mode? */ 530 541 return rc; … … 563 574 if ((fFlags & X86_CR4_PSE) && Pde.b.u1Size) 564 575 { /* (big page) */ 565 rc = PGMPhysGCPhys2HCPtr(pVM, (Pde.u & X86_PDE4M_PG_MASK) | ((RTGCUINTPTR)GCPtr & X86_PAGE_4M_OFFSET_MASK), pHCPtr);576 rc = PGMPhysGCPhys2HCPtr(pVM, (Pde.u & X86_PDE4M_PG_MASK) | ((RTGCUINTPTR)GCPtr & X86_PAGE_4M_OFFSET_MASK), 1 /* we always stay within on page */, pHCPtr); 566 577 } 567 578 else … … 573 584 VBOXPTE Pte = pPT->a[((RTGCUINTPTR)GCPtr >> X86_PT_SHIFT) & X86_PT_MASK]; 574 585 if (Pte.n.u1Present) 575 return PGMPhysGCPhys2HCPtr(pVM, (Pte.u & X86_PTE_PG_MASK) | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), pHCPtr);586 return PGMPhysGCPhys2HCPtr(pVM, (Pte.u & X86_PTE_PG_MASK) | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), 1 /* we always stay within on page */, pHCPtr); 576 587 rc = VERR_PAGE_NOT_PRESENT; 577 588 } … … 601 612 if ((fFlags & X86_CR4_PSE) && Pde.b.u1Size) 602 613 { /* (big page) */ 603 rc = PGMPhysGCPhys2HCPtr(pVM, (Pde.u & X86_PDE4M_PAE_PG_MASK) | ((RTGCUINTPTR)GCPtr & X86_PAGE_4M_OFFSET_MASK), pHCPtr);614 rc = PGMPhysGCPhys2HCPtr(pVM, (Pde.u & X86_PDE4M_PAE_PG_MASK) | ((RTGCUINTPTR)GCPtr & X86_PAGE_4M_OFFSET_MASK), 1 /* we always stay within on page */, pHCPtr); 604 615 } 605 616 else … … 611 622 X86PTEPAE Pte = pPT->a[((RTGCUINTPTR)GCPtr >> X86_PT_PAE_SHIFT) & X86_PT_PAE_MASK]; 612 623 if (Pte.n.u1Present) 613 return PGMPhysGCPhys2HCPtr(pVM, (Pte.u & X86_PTE_PAE_PG_MASK) | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), pHCPtr);624 return PGMPhysGCPhys2HCPtr(pVM, (Pte.u & X86_PTE_PAE_PG_MASK) | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), 1 /* we always stay within on page */, pHCPtr); 614 625 rc = VERR_PAGE_NOT_PRESENT; 615 626 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器