Changeset 91249 in vbox
- Timestamp:
- Sep 15, 2021 12:37:46 PM (3 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r91247 r91249 760 760 * Init the structure. 761 761 */ 762 pVM->pgm.s.offVM = RT_UOFFSETOF(VM, pgm.s);763 pVM->pgm.s.offVCpuPGM = RT_UOFFSETOF(VMCPU, pgm.s);764 762 /*pVM->pgm.s.fRestoreRomPagesAtReset = false;*/ 765 763 … … 783 781 PVMCPU pVCpu = pVM->apCpusR3[idCpu]; 784 782 PPGMCPU pPGM = &pVCpu->pgm.s; 785 786 pPGM->offVM = (uintptr_t)&pVCpu->pgm.s - (uintptr_t)pVM;787 pPGM->offVCpu = RT_UOFFSETOF(VMCPU, pgm.s);788 pPGM->offPGM = (uintptr_t)&pVCpu->pgm.s - (uintptr_t)&pVM->pgm.s;789 783 790 784 pPGM->enmShadowMode = PGMMODE_INVALID; … … 2725 2719 VMMR3DECL(int) PGMR3CheckIntegrity(PVM pVM) 2726 2720 { 2727 AssertReleaseReturn(pVM->pgm.s.offVM, VERR_INTERNAL_ERROR);2728 2729 2721 /* 2730 2722 * Check the trees. -
trunk/src/VBox/VMM/include/PGMInternal.h
r91248 r91249 2911 2911 2912 2912 /** 2913 * Converts a PGM pointer into a VM pointer.2914 * @returns Pointer to the VM structure the PGM is part of.2915 * @param pPGM Pointer to PGM instance data.2916 */2917 #define PGM2VM(pPGM) ( (PVM)((char*)pPGM - pPGM->offVM) )2918 2919 /**2920 2913 * PGM Data (part of VM) 2921 2914 */ 2922 2915 typedef struct PGM 2923 2916 { 2924 /** Offset to the VM structure. */2925 int32_t offVM;2926 /** Offset of the PGMCPU structure relative to VMCPU. */2927 int32_t offVCpuPGM;2928 2929 2917 /** @cfgm{/RamPreAlloc, boolean, false} 2930 2918 * Indicates whether the base RAM should all be allocated before starting … … 3103 3091 uint32_t cDeprecatedPageLocks; 3104 3092 /** Alignment padding. */ 3105 uint32_t au32Alignment2[1 ];3093 uint32_t au32Alignment2[1+2]; 3106 3094 3107 3095 … … 3307 3295 3308 3296 #ifdef VBOX_WITH_STATISTICS 3297 /** 3298 * Per CPU statistis for PGM (used to be on the heap). 3299 */ 3309 3300 typedef struct PGMCPUSTATS 3310 3301 { … … 3496 3487 3497 3488 /** 3498 * Converts a PGMCPU pointer into a VM pointer.3499 * @returns Pointer to the VM structure the PGM is part of.3500 * @param pPGM Pointer to PGMCPU instance data.3501 */3502 #define PGMCPU2VM(pPGM) ( (PVM)((char*)(pPGM) - (pPGM)->offVM) )3503 3504 /**3505 * Converts a PGMCPU pointer into a PGM pointer.3506 * @returns Pointer to the VM structure the PGM is part of.3507 * @param pPGMCpu Pointer to PGMCPU instance data.3508 */3509 #define PGMCPU2PGM(pPGMCpu) ( (PPGM)((char *)(pPGMCpu) - (pPGMCpu)->offPGM) )3510 3511 /**3512 3489 * PGMCPU Data (part of VMCPU). 3513 3490 */ 3514 3491 typedef struct PGMCPU 3515 3492 { 3516 /** Offset to the VM structure. */3517 int32_t offVM;3518 /** Offset to the VMCPU structure. */3519 int32_t offVCpu;3520 /** Offset of the PGM structure relative to VMCPU. */3521 int32_t offPGM;3522 uint32_t uPadding0; /**< structure size alignment. */3523 3524 3493 /** A20 gate mask. 3525 3494 * Our current approach to A20 emulation is to let REM do it and don't bother
Note:
See TracChangeset
for help on using the changeset viewer.