VirtualBox

Changeset 63660 in vbox


Ignore:
Timestamp:
Aug 30, 2016 1:38:04 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110403
Message:

MM: Added MMR3PhysGet4GBRamHoleSize, MMPhysGetRamSizeAbove4GB, and MMPhysGetRamSizeBelow4GB.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/mm.h

    r62476 r63660  
    294294 * @{ */
    295295VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM);
     296VMMR3DECL(uint32_t) MMR3PhysGetRamSizeBelow4GB(PVM pVM);
     297VMMR3DECL(uint64_t) MMR3PhysGetRamSizeAbove4GB(PVM pVM);
     298VMMR3DECL(uint32_t) MMR3PhysGet4GBRamHoleSize(PVM pVM);
    296299/** @} */
    297300
  • trunk/src/VBox/VMM/VMMR3/MM.cpp

    r62478 r63660  
    418418     * Setup the base ram (PGM).
    419419     */
     420    pVM->mm.s.cbRamHole = cbRamHole;
    420421    if (cbRam > offRamHole)
    421422    {
     423        pVM->mm.s.cbRamBelow4GB = offRamHole;
    422424        rc = PGMR3PhysRegisterRam(pVM, 0, offRamHole, "Base RAM");
    423425        if (RT_SUCCESS(rc))
     426        {
     427            pVM->mm.s.cbRamAbove4GB = cbRam - offRamHole;
    424428            rc = PGMR3PhysRegisterRam(pVM, _4G, cbRam - offRamHole, "Above 4GB Base RAM");
     429        }
    425430    }
    426431    else
    427         rc = PGMR3PhysRegisterRam(pVM, 0, RT_MIN(cbRam, offRamHole), "Base RAM");
     432    {
     433        pVM->mm.s.cbRamBelow4GB = cbRam;
     434        pVM->mm.s.cbRamAbove4GB = 0;
     435        rc = PGMR3PhysRegisterRam(pVM, 0, cbRam, "Base RAM");
     436    }
    428437
    429438    /*
     
    804813}
    805814
     815
     816/**
     817 * Get the size of RAM below 4GB (starts at address 0x00000000).
     818 *
     819 * @returns The amount of RAM below 4GB in bytes.
     820 * @param   pVM         The cross context VM structure.
     821 * @thread  Any.
     822 */
     823VMMR3DECL(uint32_t) MMR3PhysGetRamSizeBelow4GB(PVM pVM)
     824{
     825    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT32_MAX);
     826    return pVM->mm.s.cbRamBelow4GB;
     827}
     828
     829
     830/**
     831 * Get the size of RAM above 4GB (starts at address 0x000100000000).
     832 *
     833 * @returns The amount of RAM above 4GB in bytes.
     834 * @param   pVM         The cross context VM structure.
     835 * @thread  Any.
     836 */
     837VMMR3DECL(uint64_t) MMR3PhysGetRamSizeAbove4GB(PVM pVM)
     838{
     839    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT64_MAX);
     840    return pVM->mm.s.cbRamBelow4GB;
     841}
     842
     843
     844/**
     845 * Get the size of the RAM hole below 4GB.
     846 *
     847 * @returns Size in bytes.
     848 * @param   pVM         The cross context VM structure.
     849 * @thread  Any.
     850 */
     851VMMR3DECL(uint32_t) MMR3PhysGet4GBRamHoleSize(PVM pVM)
     852{
     853    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT32_MAX);
     854    return pVM->mm.s.cbRamHole;
     855}
     856
     857
  • trunk/src/VBox/VMM/include/MMInternal.h

    r62478 r63660  
    761761    /** Size of the base RAM in bytes. (The CFGM RamSize value.) */
    762762    uint64_t                    cbRamBase;
     763    /** Number of bytes of RAM above 4GB, starting at address 4GB.  */
     764    uint64_t                    cbRamAbove4GB;
     765    /** Size of the below 4GB RAM hole. */
     766    uint32_t                    cbRamHole;
     767    /** Number of bytes of RAM below 4GB, starting at address 0.  */
     768    uint32_t                    cbRamBelow4GB;
    763769    /** The number of base RAM pages that PGM has reserved (GMM).
    764770     * @remarks Shadow ROMs will be counted twice (RAM+ROM), so it won't be 1:1 with
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