VirtualBox

Changeset 107 in vbox for trunk/src/VBox/VMM/MM.cpp


Ignore:
Timestamp:
Jan 17, 2007 3:40:32 PM (18 years ago)
Author:
vboxsync
Message:

error checking. 64-bit.

File:
1 edited

Legend:

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

    r54 r107  
    193193{
    194194    LogFlow(("MMR3InitPaging:\n"));
     195    bool        fPreAlloc;
     196    int rc = CFGMR3QueryBool(CFGMR3GetRoot(pVM), "RamPreAlloc", &fPreAlloc);
     197    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     198        fPreAlloc = false;
     199    else
     200        AssertMsgRCReturn(rc, ("Configuration error: Failed to query integer \"RamPreAlloc\", rc=%Vrc.\n", rc), rc);
     201
    195202    uint64_t    cbRam;
    196     bool        fPreAlloc = false;
    197 
    198     int rc = CFGMR3QueryU64(CFGMR3GetRoot(pVM), "RamSize", &cbRam);
     203    rc = CFGMR3QueryU64(CFGMR3GetRoot(pVM), "RamSize", &cbRam);
    199204    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    200205        cbRam = 0;
    201 
    202     rc = CFGMR3QueryBool(CFGMR3GetRoot(pVM), "RamPreAlloc", &fPreAlloc);
    203     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    204         fPreAlloc = false;
    205 
    206206    if (VBOX_SUCCESS(rc) || rc == VERR_CFGM_VALUE_NOT_FOUND)
    207207    {
     
    212212        }
    213213#ifdef PGM_DYNAMIC_RAM_ALLOC
    214         Log(("MM: %llu bytes of RAM \n", cbRam));
     214        Log(("MM: %llu bytes of RAM%s\n", cbRam, fPreAlloc ? " (PreAlloc)" : ""));
    215215        pVM->mm.s.pvRamBaseHC = 0; /** @todo obsolete */
    216216        pVM->mm.s.cbRamBase   = cbRam & PAGE_BASE_GC_MASK;
     
    225225                if (fPreAlloc)
    226226                {
    227                     RTGCPHYS GCPhys = PGM_DYNAMIC_CHUNK_SIZE;
    228 
    229                     for (;GCPhys < cbRam ; GCPhys+=PGM_DYNAMIC_CHUNK_SIZE)
     227                    for (RTGCPHYS GCPhys = PGM_DYNAMIC_CHUNK_SIZE; GCPhys < cbRam; GCPhys += PGM_DYNAMIC_CHUNK_SIZE)
    230228                    {
    231229                        rc = PGM3PhysGrowRange(pVM, GCPhys);
     
    449447        PSUPPAGE    pPhysPage = &pLockedMem->aPhysPages[0];
    450448        for (unsigned c = cPages; c > 0; c--, pPhysPage++)
    451             pPhysPage->uReserved = (unsigned)pLockedMem;
     449            pPhysPage->uReserved = (RTHCUINTPTR)pLockedMem;
    452450
    453451        /*
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