VirtualBox

Changeset 28 in vbox


Ignore:
Timestamp:
Jan 15, 2007 4:48:27 PM (18 years ago)
Author:
vboxsync
Message:

Updates.

Location:
trunk/src/VBox/VMM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/MM.cpp

    r23 r28  
    211211        if (VBOX_SUCCESS(rc))
    212212        {
    213             /* Allocate the first 4 MB chunk, as we'll map ROM ranges there. */
     213            /* Allocate the first chunk, as we'll map ROM ranges there. */
    214214            rc = PGM3PhysGrowRange(pVM, (RTGCPHYS)0);
    215215            if (VBOX_SUCCESS(rc))
  • trunk/src/VBox/VMM/PGM.cpp

    r23 r28  
    11641164        {
    11651165            pCur->pNextGC = MMHyperHC2GC(pVM, pCur->pNextHC);
    1166             if (pCur->pvHCChunkGC)
    1167                 pCur->pvHCChunkGC = MMHyperHC2GC(pVM, pCur->pvHCChunkHC);
     1166            if (pCur->pavHCChunkGC)
     1167                pCur->pavHCChunkGC = MMHyperHC2GC(pVM, pCur->pavHCChunkHC);
    11681168        }
    11691169    }
     
    13021302            {
    13031303                unsigned iChunk = iPage >> (PGM_DYNAMIC_CHUNK_SHIFT - PAGE_SHIFT);
    1304                 if (pRam->pvHCChunkHC[iChunk])
    1305                     ASMMemZero32((char *)pRam->pvHCChunkHC[iChunk] + ((iPage << PAGE_SHIFT) & PGM_DYNAMIC_CHUNK_OFFSET_MASK), PAGE_SIZE);
     1304                if (pRam->pavHCChunkHC[iChunk])
     1305                    ASMMemZero32((char *)pRam->pavHCChunkHC[iChunk] + ((iPage << PAGE_SHIFT) & PGM_DYNAMIC_CHUNK_OFFSET_MASK), PAGE_SIZE);
    13061306            }
    13071307            else
     
    13971397            for (unsigned iChunk = 0; iChunk < (pRam->cb >> PGM_DYNAMIC_CHUNK_SHIFT); iChunk++)
    13981398            {
    1399                 if (pRam->pvHCChunkHC[iChunk])
     1399                if (pRam->pavHCChunkHC[iChunk])
    14001400                {
    14011401                    SSMR3PutU8(pSSM, 1);    /* chunk present */
    1402                     SSMR3PutMem(pSSM, pRam->pvHCChunkHC[iChunk], PGM_DYNAMIC_CHUNK_SIZE);
     1402                    SSMR3PutMem(pSSM, pRam->pavHCChunkHC[iChunk], PGM_DYNAMIC_CHUNK_SIZE);
    14031403                }
    14041404                else
     
    16161616                        return rc;
    16171617
    1618                     Assert(pRam->pvHCChunkHC[iChunk]);
    1619 
    1620                     SSMR3GetMem(pSSM, pRam->pvHCChunkHC[iChunk], PGM_DYNAMIC_CHUNK_SIZE);
     1618                    Assert(pRam->pavHCChunkHC[iChunk]);
     1619
     1620                    SSMR3GetMem(pSSM, pRam->pavHCChunkHC[iChunk], PGM_DYNAMIC_CHUNK_SIZE);
    16211621                }
    16221622                /* else nothing to do */
  • trunk/src/VBox/VMM/PGMInternal.h

    r23 r28  
    478478    uint32_t                            fFlags;
    479479
    480     /** HC virtual lookup ranges for 4 MB chunks. Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */
    481     GCPTRTYPE(void **)                  pvHCChunkGC; /**< @todo r=bird: ditto */
    482     /** HC virtual lookup ranges for 4 MB chunks. Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */
    483     HCPTRTYPE(void **)                  pvHCChunkHC; /**< @todo r=bird: rename to papvHCChunkHC */
     480    /** HC virtual lookup ranges for chunks. Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */
     481    GCPTRTYPE(void **)                  pavHCChunkGC;
     482    /** HC virtual lookup ranges for chunks. Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */
     483    HCPTRTYPE(void **)                  pavHCChunkHC;
    484484
    485485    /** Start of the HC mapping of the range.
     
    502502/** Return hc ptr corresponding to the ram range and physical offset */
    503503#define PGMRAMRANGE_GETHCPTR(pRam, off) \
    504     (pRam->fFlags & MM_RAM_FLAGS_DYNAMIC_ALLOC) ? (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[(off >> PGM_DYNAMIC_CHUNK_SHIFT)] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK))  \
     504    (pRam->fFlags & MM_RAM_FLAGS_DYNAMIC_ALLOC) ? (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[(off >> PGM_DYNAMIC_CHUNK_SHIFT)] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK))  \
    505505                                                : (RTHCPTR)((RTHCUINTPTR)pRam->pvHC + off);
    506506
     
    18361836                unsigned idx = (off >> PGM_DYNAMIC_CHUNK_SHIFT);
    18371837                /* Physical chunk in dynamically allocated range not present? */
    1838                 if (RT_UNLIKELY(!CTXSUFF(pRam->pvHCChunk)[idx]))
     1838                if (RT_UNLIKELY(!CTXSUFF(pRam->pavHCChunk)[idx]))
    18391839                {
    18401840#ifdef IN_RING3
     
    18461846                        return rc;
    18471847                }
    1848                 *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
     1848                *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
    18491849                return VINF_SUCCESS;
    18501850            }
     
    18811881        unsigned idx = (off >> PGM_DYNAMIC_CHUNK_SHIFT);
    18821882        /* Physical chunk in dynamically allocated range not present? */
    1883         if (RT_UNLIKELY(!CTXSUFF(pRam->pvHCChunk)[idx]))
     1883        if (RT_UNLIKELY(!CTXSUFF(pRam->pavHCChunk)[idx]))
    18841884        {
    18851885#ifdef IN_RING3
     
    18911891                return rc;
    18921892        }
    1893         *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
     1893        *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
    18941894        return VINF_SUCCESS;
    18951895    }
     
    19401940            {
    19411941                unsigned idx = (off >> PGM_DYNAMIC_CHUNK_SHIFT);
    1942                 *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
     1942                *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
    19431943                return VINF_SUCCESS;
    19441944            }
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r23 r28  
    158158        pNew->cb            = cb;
    159159        pNew->fFlags        = fFlags;
    160         pNew->pvHCChunkHC   = NULL;
    161         pNew->pvHCChunkGC   = 0;
     160        pNew->pavHCChunkHC  = NULL;
     161        pNew->pavHCChunkGC  = 0;
    162162
    163163        unsigned iPage = cb >> PAGE_SHIFT;
     
    169169        else if (fFlags & MM_RAM_FLAGS_DYNAMIC_ALLOC)
    170170        {
    171             /* Allocate memory for 4 MB chunk to HC ptr lookup array. */
    172             rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->pvHCChunkHC);
     171            /* Allocate memory for chunk to HC ptr lookup array. */
     172            rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->pavHCChunkHC);
    173173            AssertMsgReturn(rc == VINF_SUCCESS, ("MMHyperAlloc(,%#x,,,) -> %Vrc\n", cbRam, cb), rc);
    174174
    175             pNew->pvHCChunkGC = MMHyperHC2GC(pVM, pNew->pvHCChunkHC);
    176             Assert(pNew->pvHCChunkGC);
     175            pNew->pavHCChunkGC = MMHyperHC2GC(pVM, pNew->pavHCChunkHC);
     176            Assert(pNew->pavHCChunkGC);
    177177
    178178            /* Physical memory will be allocated on demand. */
     
    278278    }
    279279    off >>= (PGM_DYNAMIC_CHUNK_SHIFT - PAGE_SHIFT);
    280     pRam->pvHCChunkHC[off] = pvRam;
     280    pRam->pavHCChunkHC[off] = pvRam;
    281281
    282282    /* Notify the recompiler. */
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r23 r28  
    197197                }
    198198                unsigned idx = (off >> PGM_DYNAMIC_CHUNK_SHIFT);
    199                 *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
     199                *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[idx] + (off & PGM_DYNAMIC_CHUNK_OFFSET_MASK));
    200200                return VINF_SUCCESS;
    201201            }
     
    236236            for (unsigned iChunk = 0; iChunk < (pRam->cb >> PGM_DYNAMIC_CHUNK_SHIFT); iChunk++)
    237237            {
    238                 if (CTXSUFF(pRam->pvHCChunk)[iChunk])
    239                 {
    240                     RTHCUINTPTR off = (RTHCUINTPTR)HCPtr - (RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[iChunk];
     238                if (CTXSUFF(pRam->pavHCChunk)[iChunk])
     239                {
     240                    RTHCUINTPTR off = (RTHCUINTPTR)HCPtr - (RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[iChunk];
    241241                    if (off < PGM_DYNAMIC_CHUNK_SIZE)
    242242                        return true;
     
    277277            for (unsigned iChunk = 0; iChunk < (pRam->cb >> PGM_DYNAMIC_CHUNK_SHIFT); iChunk++)
    278278            {
    279                 if (CTXSUFF(pRam->pvHCChunk)[iChunk])
    280                 {
    281                     RTHCUINTPTR off = (RTHCUINTPTR)HCPtr - (RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[iChunk];
     279                if (CTXSUFF(pRam->pavHCChunk)[iChunk])
     280                {
     281                    RTHCUINTPTR off = (RTHCUINTPTR)HCPtr - (RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[iChunk];
    282282                    if (off < PGM_DYNAMIC_CHUNK_SIZE)
    283283                    {
     
    325325            for (unsigned iChunk = 0; iChunk < (pRam->cb >> PGM_DYNAMIC_CHUNK_SHIFT); iChunk++)
    326326            {
    327                 if (CTXSUFF(pRam->pvHCChunk)[iChunk])
    328                 {
    329                     RTHCUINTPTR off = (RTHCUINTPTR)HCPtr - (RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[iChunk];
     327                if (CTXSUFF(pRam->pavHCChunk)[iChunk])
     328                {
     329                    RTHCUINTPTR off = (RTHCUINTPTR)HCPtr - (RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[iChunk];
    330330                    if (off < PGM_DYNAMIC_CHUNK_SIZE)
    331331                    {
     
    459459                        unsigned idx = (iPage >> (PGM_DYNAMIC_CHUNK_SHIFT - PAGE_SHIFT));
    460460
    461                         *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pvHCChunk)[idx] + ((iPage << PAGE_SHIFT) & PGM_DYNAMIC_CHUNK_OFFSET_MASK) + off);
     461                        *pHCPtr = (RTHCPTR)((RTHCUINTPTR)CTXSUFF(pRam->pavHCChunk)[idx] + ((iPage << PAGE_SHIFT) & PGM_DYNAMIC_CHUNK_OFFSET_MASK) + off);
    462462                    }
    463463                    else
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