VirtualBox

Changeset 6830 in vbox


Ignore:
Timestamp:
Feb 6, 2008 2:30:13 PM (17 years ago)
Author:
vboxsync
Message:

Used PGMR3PhysRegisterRam.

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

Legend:

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

    r6817 r6830  
    314314    }
    315315
     316    /*
     317     * Setup the base ram (PGM).
     318     */
     319    rc = PGMR3PhysRegisterRam(pVM, 0, cbRam, "Base RAM");
    316320#ifdef VBOX_WITH_NEW_PHYS_CODE
    317     /*
    318      * Setup the base ram (PGM).
    319      */
    320     rc = PGMR3PhysRegisterRam(pVM, 0, cbRam, "Base RAM");
    321321    if (RT_SUCCESS(rc) && fPreAlloc)
    322322    {
    323         /** @todo implement RamPreAlloc if it is *really* needed - in PGM preferably. (lazy bird) */
     323        /** @todo RamPreAlloc should be handled at the very end of the VM creation. (lazy bird) */
    324324        return VM_SET_ERROR(pVM, VERR_NOT_IMPLEMENTED, "TODO: RamPreAlloc");
    325325    }
    326 
    327326#else
    328     rc = MMR3PhysRegisterEx(pVM, NULL, 0, cbRam, MM_RAM_FLAGS_DYNAMIC_ALLOC, MM_PHYS_TYPE_NORMAL, "Main Memory");
    329327    if (RT_SUCCESS(rc))
    330328    {
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r6829 r6830  
    145145    pNew->pvHC          = NULL;
    146146
     147#ifndef VBOX_WITH_NEW_PHYS_CODE
     148    /* Allocate memory for chunk to HC ptr lookup array. */
     149    rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->pavHCChunkHC);
     150    AssertRCReturn(rc, rc);
     151    pNew->pavHCChunkGC = MMHyperCCToGC(pVM, pNew->pavHCChunkHC);
     152    pNew->fFlags |= MM_RAM_FLAGS_DYNAMIC_ALLOC;
     153
     154#endif
    147155    RTGCPHYS iPage = cPages;
    148156    while (iPage-- > 0)
    149157    {
     158#ifdef VBOX_WITH_NEW_PHYS_CODE
    150159        pNew->aPages[iPage].HCPhys = pVM->pgm.s.HCPhysZeroPg;
     160#else
     161        pNew->aPages[iPage].HCPhys = 0;
     162#endif
    151163        pNew->aPages[iPage].u2State = PGM_PAGE_STATE_ZERO;
    152164        pNew->aPages[iPage].fWrittenTo = 0;
     
    177189    }
    178190    pgmUnlock(pVM);
     191
     192    /*
     193     * Notify REM.
     194     */
     195#ifdef VBOX_WITH_NEW_PHYS_CODE
     196    REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, 0);
     197#else
     198    REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, MM_RAM_FLAGS_DYNAMIC_ALLOC);
     199#endif
    179200
    180201    return VINF_SUCCESS;
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