Changeset 93617 in vbox for trunk/src/VBox/VMM/include
- Timestamp:
- Feb 6, 2022 8:35:16 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/PGMInternal.h
r93593 r93617 1984 1984 /** The VM handle - R0 Ptr. */ 1985 1985 R0PTRTYPE(PVMCC) pVMR0; 1986 /** The ring-3 pointer to this structure. */ 1987 R3PTRTYPE(struct PGMPOOL *) pPoolR3; 1988 /** The ring-0 pointer to this structure. */ 1989 R0PTRTYPE(struct PGMPOOL *) pPoolR0; 1986 1990 /** The max pool size. This includes the special IDs. */ 1987 1991 uint16_t cMaxPages; … … 3666 3670 void pgmPoolResetDirtyPage(PVMCC pVM, RTGCPTR GCPtrPage); 3667 3671 3672 /** Gets the ring-0 pointer for the given pool page. */ 3673 DECLINLINE(R0PTRTYPE(PPGMPOOLPAGE)) pgmPoolConvertPageToR0(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 3674 { 3675 #ifdef IN_RING3 3676 size_t offPage = (uintptr_t)pPage - (uintptr_t)pPool; 3677 # ifdef VBOX_STRICT 3678 size_t iPage = (offPage - RT_UOFFSETOF(PGMPOOL, aPages)) / sizeof(*pPage); 3679 AssertReturn(iPage < pPool->cMaxPages, NIL_RTR0PTR); 3680 AssertReturn(iPage * sizeof(*pPage) + RT_UOFFSETOF(PGMPOOL, aPages) == offPage, NIL_RTR0PTR); 3681 # endif 3682 return pPool->pPoolR0 + offPage; 3683 #else 3684 RT_NOREF(pPool); 3685 return pPage; 3686 #endif 3687 } 3688 3689 /** Gets the ring-3 pointer for the given pool page. */ 3690 DECLINLINE(R3PTRTYPE(PPGMPOOLPAGE)) pgmPoolConvertPageToR3(PPGMPOOL pPool, PPGMPOOLPAGE pPage) 3691 { 3692 #ifdef IN_RING3 3693 RT_NOREF(pPool); 3694 return pPage; 3695 #else 3696 size_t offPage = (uintptr_t)pPage - (uintptr_t)pPool; 3697 # ifdef VBOX_STRICT 3698 size_t iPage = (offPage - RT_UOFFSETOF(PGMPOOL, aPages)) / sizeof(*pPage); 3699 AssertReturn(iPage < pPool->cMaxPages, NIL_RTR3PTR); 3700 AssertReturn(iPage * sizeof(*pPage) + RT_UOFFSETOF(PGMPOOL, aPages) == offPage, NIL_RTR3PTR); 3701 # endif 3702 return pPool->pPoolR3 + offPage; 3703 #endif 3704 } 3705 3668 3706 int pgmR3ExitShadowModeBeforePoolFlush(PVMCPU pVCpu); 3669 3707 int pgmR3ReEnterShadowModeAfterPoolFlush(PVM pVM, PVMCPU pVCpu);
Note:
See TracChangeset
for help on using the changeset viewer.