Changeset 5661 in vbox
- Timestamp:
- Nov 10, 2007 10:29:02 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r5605 r5661 2829 2829 2830 2830 /** 2831 * Gets the page directory for the specified address and returns the index into the page directory 2832 * 2833 * @returns Pointer to the page directory in question. 2834 * @returns NULL if the page directory is not present or on an invalid page. 2835 * @param pPGM Pointer to the PGM instance data. 2836 * @param GCPtr The address. 2837 * @param piPD Receives the index into the returned page directory 2838 */ 2839 DECLINLINE(PX86PDPAE) pgmGstGetPaePDPtr(PPGM pPGM, RTGCUINTPTR GCPtr, unsigned *piPD) 2840 { 2841 const unsigned iPdPtr = GCPtr >> X86_PDPTR_SHIFT; 2842 if (CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].n.u1Present) 2843 { 2844 const unsigned iPD = (GCPtr >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK; 2845 if ((CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK) == pPGM->aGCPhysGstPaePDs[iPdPtr]) 2846 { 2847 *piPD = iPD; 2848 return CTXSUFF(pPGM->apGstPaePDs)[iPdPtr]; 2849 } 2850 2851 /* cache is out-of-sync. */ 2852 PX86PDPAE pPD; 2853 int rc = PGM_GCPHYS_2_PTR(PGM2VM(pPGM), CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u & X86_PDPE_PG_MASK, &pPD); 2854 if (VBOX_SUCCESS(rc)) 2855 { 2856 *piPD = iPD; 2857 return pPD; 2858 } 2859 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u)); 2860 /* returning NIL_RTGCPHYS is ok if we assume it's just an invalid page of some kind emualted as all 0s. */ 2861 } 2862 return NULL; 2863 } 2864 2865 2866 /** 2831 2867 * Checks if any of the specified page flags are set for the given page. 2832 2868 *
Note:
See TracChangeset
for help on using the changeset viewer.