VirtualBox

Changeset 5629 in vbox


Ignore:
Timestamp:
Nov 5, 2007 9:48:30 PM (17 years ago)
Author:
vboxsync
Message:

remove deprecated macros

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/param.h

    r5265 r5629  
    8383#define PAGE_ADDRESS(pv)    ((uintptr_t)(pv) & ~(uintptr_t)0xfff)
    8484
    85 #if 1 /** @todo remove this! Use X86_PAGE_* defines. */
    86 /**
    87  * i386 Page directory shift.
    88  * This is used to convert between PDR index and virtual address.
    89  * @deprecated Use X86_*.
    90  */
    91 #define PGDIR_SHIFT         22
    92 
    93 /**
    94  * i386 Page table mask.
    95  * This is used together with PAGE_SHIFT to get the page table
    96  * index from a virtual address.
    97  * @deprecated Use X86_*.
    98  */
    99 #define PTE_MASK            0x3ff
    100 
    101 /**
    102  * i386 Page table and page directory entry count for the default
    103  * paging mode.
    104  * @deprecated Use X86_*.
    105  */
    106 #define PAGE_ENTRIES        1024
    107 
    108 /**
    109  * i386 4MB Page offset mask.
    110  * @deprecated Use X86_*.
    111  */
    112 #define PAGE_OFFSET_MASK_BIG    0x3fffff
    113 #endif /* obsolete */
    114 
    11585/**
    11686 * Host max path (the reasonable value).
  • trunk/src/VBox/VMM/PGM.cpp

    r5605 r5629  
    14231423    rc = MMR3HyperReserve(pVM, MM_HYPER_DYNAMIC_SIZE, "Dynamic mapping", &pVM->pgm.s.pbDynPageMapBaseGC);
    14241424    if (    VBOX_SUCCESS(rc)
    1425         &&  (pVM->pgm.s.pbDynPageMapBaseGC >> PGDIR_SHIFT) != ((pVM->pgm.s.pbDynPageMapBaseGC + MM_HYPER_DYNAMIC_SIZE - 1) >> PGDIR_SHIFT))
     1425        &&  (pVM->pgm.s.pbDynPageMapBaseGC >> X86_PD_SHIFT) != ((pVM->pgm.s.pbDynPageMapBaseGC + MM_HYPER_DYNAMIC_SIZE - 1) >> X86_PD_SHIFT))
    14261426        rc = MMR3HyperReserve(pVM, MM_HYPER_DYNAMIC_SIZE, "Dynamic mapping not crossing", &pVM->pgm.s.pbDynPageMapBaseGC);
    14271427    if (VBOX_SUCCESS(rc))
    14281428    {
    1429         AssertRelease((pVM->pgm.s.pbDynPageMapBaseGC >> PGDIR_SHIFT) == ((pVM->pgm.s.pbDynPageMapBaseGC + MM_HYPER_DYNAMIC_SIZE - 1) >> PGDIR_SHIFT));
     1429        AssertRelease((pVM->pgm.s.pbDynPageMapBaseGC >> X86_PD_SHIFT) == ((pVM->pgm.s.pbDynPageMapBaseGC + MM_HYPER_DYNAMIC_SIZE - 1) >> X86_PD_SHIFT));
    14301430        MMR3HyperReserve(pVM, PAGE_SIZE, "fence", NULL);
    14311431    }
     
    19441944        if (pMapping->GCPtr != GCPtr)
    19451945        {
    1946             AssertMsg((GCPtr >> PGDIR_SHIFT << PGDIR_SHIFT) == GCPtr, ("GCPtr=%VGv\n", GCPtr));
     1946            AssertMsg((GCPtr >> X86_PD_SHIFT << X86_PD_SHIFT) == GCPtr, ("GCPtr=%VGv\n", GCPtr));
    19471947#if HC_ARCH_BITS == 64
    19481948LogRel(("Mapping: %VGv -> %VGv %s\n", pMapping->GCPtr, GCPtr, pMapping->pszDesc));
    19491949#endif
    1950             pgmR3MapRelocate(pVM, pMapping, pMapping->GCPtr >> PGDIR_SHIFT, GCPtr >> PGDIR_SHIFT);
     1950            pgmR3MapRelocate(pVM, pMapping, pMapping->GCPtr >> X86_PD_SHIFT, GCPtr >> X86_PD_SHIFT);
    19511951        }
    19521952        else
  • trunk/src/VBox/VMM/PGMMap.cpp

    r5348 r5629  
    110110     * Check for conflicts with intermediate mappings.
    111111     */
    112     const unsigned iPageDir = GCPtr >> PGDIR_SHIFT;
    113     const unsigned cPTs = cb >> PGDIR_SHIFT;
     112    const unsigned iPageDir = GCPtr >> X86_PD_SHIFT;
     113    const unsigned cPTs = cb >> X86_PD_SHIFT;
    114114    unsigned    i;
    115115    for (i = 0; i < cPTs; i++)
     
    247247             */
    248248            MMHyperFree(pVM, pCur->aPTs[0].pPTR3);
    249             pgmR3MapClearPDEs(&pVM->pgm.s, pCur, pCur->GCPtr >> PGDIR_SHIFT);
     249            pgmR3MapClearPDEs(&pVM->pgm.s, pCur, pCur->GCPtr >> X86_PD_SHIFT);
    250250            MMHyperFree(pVM, pCur);
    251251
     
    303303     * This is all or nothing at all. So, a tiny bit of paranoia first.
    304304     */
    305     if (GCPtrBase & PAGE_OFFSET_MASK_BIG)
     305    if (GCPtrBase & X86_PAGE_4M_OFFSET_MASK)
    306306    {
    307307        AssertMsgFailed(("GCPtrBase (%#x) has to be aligned on a 4MB address!\n", GCPtrBase));
    308308        return VERR_INVALID_PARAMETER;
    309309    }
    310     if (!cb || (cb & PAGE_OFFSET_MASK_BIG))
     310    if (!cb || (cb & X86_PAGE_4M_OFFSET_MASK))
    311311    {
    312312        AssertMsgFailed(("cb (%#x) is 0 or not aligned on a 4MB address!\n", cb));
     
    323323     * Check that it's not conflicting with a core code mapping in the intermediate page table.
    324324     */
    325     unsigned    iPDNew = GCPtrBase >> PGDIR_SHIFT;
    326     unsigned    i = cb >> PGDIR_SHIFT;
     325    unsigned    iPDNew = GCPtrBase >> X86_PD_SHIFT;
     326    unsigned    i = cb >> X86_PD_SHIFT;
    327327    while (i-- > 0)
    328328    {
     
    333333            while (pCur)
    334334            {
    335                 if (iPDNew + i - (pCur->GCPtr >> PGDIR_SHIFT) < (pCur->cb >> PGDIR_SHIFT))
     335                if (iPDNew + i - (pCur->GCPtr >> X86_PD_SHIFT) < (pCur->cb >> X86_PD_SHIFT))
    336336                    break;
    337337                pCur = pCur->pNextR3;
     
    376376    while (pCur)
    377377    {
    378         unsigned iPDOld = pCur->GCPtr >> PGDIR_SHIFT;
    379         iPDNew = GCPtrCur >> PGDIR_SHIFT;
     378        unsigned iPDOld = pCur->GCPtr >> X86_PD_SHIFT;
     379        iPDNew = GCPtrCur >> X86_PD_SHIFT;
    380380
    381381        /*
     
    394394         * Callback to execute the relocation.
    395395         */
    396         pCur->pfnRelocate(pVM, iPDOld << PGDIR_SHIFT, iPDNew << PGDIR_SHIFT, PGMRELOCATECALL_RELOCATE, pCur->pvUser);
     396        pCur->pfnRelocate(pVM, iPDOld << X86_PD_SHIFT, iPDNew << X86_PD_SHIFT, PGMRELOCATECALL_RELOCATE, pCur->pvUser);
    397397
    398398        /*
     
    786786void pgmR3MapRelocate(PVM pVM, PPGMMAPPING pMapping, int iPDOld, int iPDNew)
    787787{
    788     Log(("PGM: Relocating %s from %#x to %#x\n", pMapping->pszDesc, iPDOld << PGDIR_SHIFT, iPDNew << PGDIR_SHIFT));
    789     Assert(((unsigned)iPDOld << PGDIR_SHIFT) == pMapping->GCPtr);
     788    Log(("PGM: Relocating %s from %#x to %#x\n", pMapping->pszDesc, iPDOld << X86_PD_SHIFT, iPDNew << X86_PD_SHIFT));
     789    Assert(((unsigned)iPDOld << X86_PD_SHIFT) == pMapping->GCPtr);
    790790
    791791    /*
     
    811811
    812812    /* Find mapping which >= than pMapping. */
    813     RTGCPTR     GCPtrNew = iPDNew << PGDIR_SHIFT;
     813    RTGCPTR     GCPtrNew = iPDNew << X86_PD_SHIFT;
    814814    PPGMMAPPING pPrev = NULL;
    815815    pCur = pVM->pgm.s.pMappingsR3;
     
    870870     * Callback to execute the relocation.
    871871     */
    872     pMapping->pfnRelocate(pVM, iPDOld << PGDIR_SHIFT, iPDNew << PGDIR_SHIFT, PGMRELOCATECALL_RELOCATE, pMapping->pvUser);
     872    pMapping->pfnRelocate(pVM, iPDOld << X86_PD_SHIFT, iPDNew << X86_PD_SHIFT, PGMRELOCATECALL_RELOCATE, pMapping->pvUser);
    873873}
    874874
     
    924924         * Ask the mapping.
    925925         */
    926         if (pMapping->pfnRelocate(pVM, iPDOld << PGDIR_SHIFT, iPDNew << PGDIR_SHIFT, PGMRELOCATECALL_SUGGEST, pMapping->pvUser))
     926        if (pMapping->pfnRelocate(pVM, iPDOld << X86_PD_SHIFT, iPDNew << X86_PD_SHIFT, PGMRELOCATECALL_SUGGEST, pMapping->pvUser))
    927927        {
    928928            pgmR3MapRelocate(pVM, pMapping, iPDOld, iPDNew);
     
    933933
    934934    STAM_PROFILE_STOP(&pVM->pgm.s.StatHCResolveConflict, a);
    935     AssertMsgFailed(("Failed to relocate page table mapping '%s' from %#x! (cPTs=%d)\n", pMapping->pszDesc, iPDOld << PGDIR_SHIFT, cPTs));
     935    AssertMsgFailed(("Failed to relocate page table mapping '%s' from %#x! (cPTs=%d)\n", pMapping->pszDesc, iPDOld << X86_PD_SHIFT, cPTs));
    936936    return VERR_PGM_NO_HYPERVISOR_ADDRESS;
    937937}
     
    968968    for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3)
    969969    {
    970         unsigned iPDE = pCur->GCPtr >> PGDIR_SHIFT;
     970        unsigned iPDE = pCur->GCPtr >> X86_PD_SHIFT;
    971971        unsigned iPT = pCur->cPTs;
    972972        while (iPT-- > 0)
     
    978978                Log(("PGMR3HasMappingConflicts: Conflict was detected at %VGv for mapping %s\n"
    979979                     "                          iPDE=%#x iPT=%#x PDE=%VGp.\n",
    980                      (iPT + iPDE) << PGDIR_SHIFT, pCur->pszDesc,
     980                     (iPT + iPDE) << X86_PD_SHIFT, pCur->pszDesc,
    981981                     iPDE, iPT, pPD->a[iPDE + iPT].au32[0]));
    982982                #else
    983983                AssertMsgFailed(("PGMR3HasMappingConflicts: Conflict was detected at %VGv for mapping %s\n"
    984984                                 "                          iPDE=%#x iPT=%#x PDE=%VGp.\n",
    985                                  (iPT + iPDE) << PGDIR_SHIFT, pCur->pszDesc,
     985                                 (iPT + iPDE) << X86_PD_SHIFT, pCur->pszDesc,
    986986                                 iPDE, iPT, pPD->a[iPDE + iPT].au32[0]));
    987987                #endif
     
    10481048            }
    10491049
    1050             unsigned iPT  = off >> PGDIR_SHIFT;
    1051             unsigned iPTE = (off >> PAGE_SHIFT) & PTE_MASK;
     1050            unsigned iPT  = off >> X86_PD_SHIFT;
     1051            unsigned iPTE = (off >> PAGE_SHIFT) & X86_PT_MASK;
    10521052            while (cb > 0 && iPTE < ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a))
    10531053            {
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r5605 r5629  
    273273            &&  (cr4 & X86_CR4_PSE))
    274274            GCPhys = (PdeSrc.u & X86_PDE4M_PG_MASK)
    275                     | ((RTGCPHYS)pvFault & (PAGE_OFFSET_MASK_BIG ^ PAGE_OFFSET_MASK));
     275                    | ((RTGCPHYS)pvFault & (X86_PAGE_4M_OFFSET_MASK ^ PAGE_OFFSET_MASK));
    276276        else
    277277        {
     
    286286            if (VBOX_SUCCESS(rc))
    287287            {
    288                 unsigned iPTESrc = ((RTGCUINTPTR)pvFault >> PAGE_SHIFT) & PTE_MASK;
     288                unsigned iPTESrc = ((RTGCUINTPTR)pvFault >> PAGE_SHIFT) & X86_PT_MASK;
    289289                if (pPTSrc->a[iPTESrc].n.u1Present)
    290290                    GCPhys = pPTSrc->a[iPTESrc].u & X86_PTE_PG_MASK;
     
    14551455                 */
    14561456                /* Calculate the GC physical address of this 4KB shadow page. */
    1457                 RTGCPHYS GCPhys = (PdeSrc.u & X86_PDE4M_PAE_PG_MASK) | ((RTGCUINTPTR)GCPtrPage & PAGE_OFFSET_MASK_BIG);
     1457                RTGCPHYS GCPhys = (PdeSrc.u & X86_PDE4M_PAE_PG_MASK) | ((RTGCUINTPTR)GCPtrPage & X86_PAGE_4M_OFFSET_MASK);
    14581458                /* Find ram range. */
    14591459                PPGMPAGE pPage;
     
    16961696                if (VBOX_SUCCESS(rc))
    16971697                {
    1698                     PVBOXPTE        pPteSrc = &pPTSrc->a[(GCPtrPage >> PAGE_SHIFT) & PTE_MASK];
     1698                    PVBOXPTE        pPteSrc = &pPTSrc->a[(GCPtrPage >> PAGE_SHIFT) & X86_PT_MASK];
    16991699                    const VBOXPTE   PteSrc = *pPteSrc;
    17001700                    if (pPteSrc->n.u1Present)
     
    17531753         * Real page fault?
    17541754         */
    1755         PVBOXPTE        pPteSrc = &pPTSrc->a[(GCPtrPage >> PAGE_SHIFT) & PTE_MASK];
     1755        PVBOXPTE        pPteSrc = &pPTSrc->a[(GCPtrPage >> PAGE_SHIFT) & X86_PT_MASK];
    17561756        const VBOXPTE   PteSrc = *pPteSrc;
    17571757        if (    !PteSrc.n.u1Present
     
    26142614    {
    26152615        pMapping      = pVM->pgm.s.CTXALLSUFF(pMappings);
    2616         iPdNoMapping  = (pMapping) ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U;
     2616        iPdNoMapping  = (pMapping) ? pMapping->GCPtr >> X86_PD_SHIFT : ~0U;
    26172617    }
    26182618    else
     
    26452645                    pPDEDst += cPTs + (PGM_SHW_TYPE != PGM_TYPE_32BIT) * cPTs;
    26462646                    pMapping = pMapping->CTXALLSUFF(pNext);
    2647                     iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U;
     2647                    iPdNoMapping = pMapping ? pMapping->GCPtr >> X86_PD_SHIFT : ~0U;
    26482648                    continue;
    26492649                }
     
    26582658                 */
    26592659                pMapping = pVM->pgm.s.pMappingsR3;
    2660                 while (pMapping && pMapping->GCPtr < (iPD << PGDIR_SHIFT))
     2660                while (pMapping && pMapping->GCPtr < (iPD << X86_PD_SHIFT))
    26612661                    pMapping = pMapping->pNextR3;
    2662                 iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U;
     2662                iPdNoMapping = pMapping ? pMapping->GCPtr >> X86_PD_SHIFT : ~0U;
    26632663#else
    26642664                LogFlow(("SyncCR3: detected conflict -> VINF_PGM_SYNC_CR3\n"));
     
    27782778                /* It's fixed, just skip the mapping. */
    27792779                pMapping = pMapping->CTXALLSUFF(pNext);
    2780                 iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U;
     2780                iPdNoMapping = pMapping ? pMapping->GCPtr >> X86_PD_SHIFT : ~0U;
    27812781            }
    27822782            else
     
    28022802                         */
    28032803                        pMapping = pVM->pgm.s.CTXALLSUFF(pMappings);
    2804                         while (pMapping && pMapping->GCPtr < (iPD << PGDIR_SHIFT))
     2804                        while (pMapping && pMapping->GCPtr < (iPD << X86_PD_SHIFT))
    28052805                            pMapping = pMapping->CTXALLSUFF(pNext);
    2806                         iPdNoMapping = pMapping ? pMapping->GCPtr >> PGDIR_SHIFT : ~0U;
     2806                        iPdNoMapping = pMapping ? pMapping->GCPtr >> X86_PD_SHIFT : ~0U;
    28072807                        break;
    28082808#  else
     
    28162816                    pMapping = pMapping->CTXALLSUFF(pNext);
    28172817                    if (pMapping)
    2818                         iPdNoMapping = pMapping->GCPtr >> PGDIR_SHIFT;
     2818                        iPdNoMapping = pMapping->GCPtr >> X86_PD_SHIFT;
    28192819                }
    28202820            }
  • trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp

    r4071 r5629  
    8383            {
    8484                RTGCUINTPTR     off = GCPtr - pCur->GCPtr;
    85                 const unsigned  iPT = off >> PGDIR_SHIFT;
    86                 const unsigned  iPageNo = (off >> PAGE_SHIFT) & PTE_MASK;
     85                const unsigned  iPT = off >> X86_PD_SHIFT;
     86                const unsigned  iPageNo = (off >> PAGE_SHIFT) & X86_PT_MASK;
    8787
    8888                /* 32-bit */
     
    183183            while (cb > 0)
    184184            {
    185                 unsigned iPT  = off >> PGDIR_SHIFT;
    186                 unsigned iPTE = (off >> PAGE_SHIFT) & PTE_MASK;
     185                unsigned iPT  = off >> X86_PD_SHIFT;
     186                unsigned iPTE = (off >> PAGE_SHIFT) & X86_PT_MASK;
    187187                while (cb > 0 && iPTE < ELEMENTS(CTXALLSUFF(pCur->aPTs[iPT].pPT)->a))
    188188                {
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r4071 r5629  
    185185        AssertMsgReturn(pMap, ("GCPtr=%VGv\n", GCPtr), VERR_INTERNAL_ERROR);
    186186#if PGM_SHW_TYPE == PGM_TYPE_32BIT
    187         pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> PGDIR_SHIFT].CTXALLSUFF(pPT);
     187        pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> X86_PD_SHIFT].CTXALLSUFF(pPT);
    188188#else /* PAE and AMD64: */
    189         pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> PGDIR_SHIFT].CTXALLSUFF(paPaePTs);
     189        pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> X86_PD_SHIFT].CTXALLSUFF(paPaePTs);
    190190#endif
    191191    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette