VirtualBox

Changeset 12968 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Oct 3, 2008 12:16:13 AM (16 years ago)
Author:
vboxsync
Message:

#1865: MM done for now (needs revisiting later).

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

Legend:

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

    r12967 r12968  
    3030 *      - Locked process memory - Guest RAM and other. (reduce/obsolete this)
    3131 *      - Physical guest memory (RAM & ROM) - Moving to PGM. (obsolete this)
     32 *
     33 * The global memory manager (GMM) is the global counter part / partner of MM.
     34 * MM will provide therefore ring-3 callable interfaces for some of the GMM APIs
     35 * related to resource tracking (PGM is the user).
    3236 *
    3337 *
     
    139143
    140144
    141 
    142145/*******************************************************************************
    143146*   Header Files                                                               *
     
    175178
    176179
     180
     181
    177182/**
    178183 * Initializes the MM members of the UVM.
     
    212217 * MM determins the virtual address of the hypvervisor memory area by
    213218 * checking for location at previous run. If that property isn't available
    214  * it will choose a default starting location, currently 0xe0000000.
     219 * it will choose a default starting location, currently 0xa0000000.
    215220 *
    216221 * @returns VBox status code.
     
    460465    pVM->mm.s.offVM          = 0;           /* init assertion on this */
    461466
    462     return 0;
     467    return VINF_SUCCESS;
    463468}
    464469
     
    555560    if (cPages != pVM->mm.s.cBasePages)
    556561    {
    557         Log(("mmR3Load: Memory configuration has changed. cPages=%#RX64 saved=%#RX64\n", pVM->mm.s.cBasePages, cPages));
     562        LogRel(("mmR3Load: Memory configuration has changed. cPages=%#RX64 saved=%#RX64\n", pVM->mm.s.cBasePages, cPages));
    558563        return VERR_SSM_LOAD_MEMORY_SIZE_MISMATCH;
    559564    }
     
    572577    if (cb != pVM->mm.s.cbRamBase)
    573578    {
    574         Log(("mmR3Load: Memory configuration has changed. cbRamBase=%#RX64 save=%#RX64\n", pVM->mm.s.cbRamBase, cb));
     579        LogRel(("mmR3Load: Memory configuration has changed. cbRamBase=%#RX64 save=%#RX64\n", pVM->mm.s.cbRamBase, cb));
    575580        return VERR_SSM_LOAD_MEMORY_SIZE_MISMATCH;
    576581    }
     
    805810 * @param   ppv         Where to store the resulting address.
    806811 * @thread  The Emulation Thread.
     812 *
     813 * @remarks Avoid whenever possible.
     814 *          Intended for the debugger facility only.
     815 * @todo    Rename to indicate the special usage.
    807816 */
    808817MMR3DECL(int) MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv)
     
    843852 * @param   GCPtr       GC virtual address.
    844853 * @param   cb          Number of bytes to read.
     854 *
     855 * @remarks Intended for the debugger facility only.
     856 * @todo    Move to DBGF, it's only selecting which functions to use!
    845857 */
    846858MMR3DECL(int) MMR3ReadGCVirt(PVM pVM, void *pvDst, RTGCPTR GCPtr, size_t cb)
     
    860872 * @param   pvSrc       The source address (HC of course).
    861873 * @param   cb          Number of bytes to read.
     874 *
     875 * @remarks Intended for the debugger facility only.
     876 * @todo    Move to DBGF, it's only selecting which functions to use!
    862877 */
    863878MMR3DECL(int) MMR3WriteGCVirt(PVM pVM, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb)
  • trunk/src/VBox/VMM/MMHyper.cpp

    r12967 r12968  
    1919 * additional information or have any questions.
    2020 */
    21 
    22 
    2321
    2422
     
    5048
    5149
     50
     51
    5252/**
    5353 * Initializes the hypvervisor related MM stuff without
     
    515515
    516516
    517 
    518 
    519517/**
    520518 * Locks and Maps HC virtual memory into the hypervisor region in the GC.
     
    787785    AssertReturn(cbAligned >= cb, VERR_INVALID_PARAMETER);
    788786    void *pv;
    789     int rc = SUPPageAlloc(cbAligned >> PAGE_SHIFT, &pv);
     787    int rc = SUPPageAlloc(cbAligned >> PAGE_SHIFT, &pv); /** @todo #1865: heap allocation must be changed for osx (only). */
    790788    if (VBOX_SUCCESS(rc))
    791789    {
     
    10601058 * @param   GCPtr       GC virtual address.
    10611059 * @param   cb          Number of bytes to read.
     1060 *
     1061 * @remarks For DBGF only.
    10621062 */
    10631063MMR3DECL(int) MMR3HyperReadGCVirt(PVM pVM, void *pvDst, RTGCPTR GCPtr, size_t cb)
  • trunk/src/VBox/VMM/MMInternal.h

    r12967 r12968  
    351351 * related to a MMPAGESUBPOOL node in one chunk. That means that after the
    352352 * bitmap (which is of variable size) comes the SUPPAGE records and then
    353  * follows the lookup tree nodes.
     353 * follows the lookup tree nodes. (The heap in question is the hyper heap.)
    354354 */
    355355typedef struct MMPAGESUBPOOL
    356356{
    357357    /** Pointer to next sub pool. */
    358     struct MMPAGESUBPOOL   *pNext;
     358    R3R0PTRTYPE(struct MMPAGESUBPOOL *) pNext;
    359359    /** Pointer to next sub pool in the free chain.
    360360     * This is NULL if we're not in the free chain or at the end of it. */
    361     struct MMPAGESUBPOOL   *pNextFree;
     361    R3R0PTRTYPE(struct MMPAGESUBPOOL *) pNextFree;
    362362    /** Pointer to array of lock ranges.
    363363     * This is allocated together with the MMPAGESUBPOOL and thus needs no freeing.
     
    365365     * The reserved field is a pointer to this structure.
    366366     */
    367     PSUPPAGE                paPhysPages;
     367    R3R0PTRTYPE(PSUPPAGE)   paPhysPages;
    368368    /** Pointer to the first page. */
    369     void                   *pvPages;
     369    R3R0PTRTYPE(void *)     pvPages;
    370370    /** Size of the subpool. */
    371371    unsigned                cPages;
     
    387387{
    388388    /** List of subpools. */
    389     PMMPAGESUBPOOL          pHead;
     389    R3R0PTRTYPE(PMMPAGESUBPOOL) pHead;
    390390    /** Head of subpools with free pages. */
    391     PMMPAGESUBPOOL          pHeadFree;
     391    R3R0PTRTYPE(PMMPAGESUBPOOL) pHeadFree;
    392392    /** AVLPV tree for looking up HC virtual addresses.
    393393     * The tree contains MMLOOKUPVIRTPP records.
    394394     */
    395     PAVLPVNODECORE          pLookupVirt;
     395    R3R0PTRTYPE(PAVLPVNODECORE) pLookupVirt;
    396396    /** Tree for looking up HC physical addresses.
    397397     * The tree contains MMLOOKUPPHYSHC records.
    398398     */
    399     AVLHCPHYSTREE           pLookupPhys;
     399    R3R0PTRTYPE(AVLHCPHYSTREE)  pLookupPhys;
    400400    /** Pointer to the VM this pool belongs. */
    401     PVM                     pVM;
     401    R3R0PTRTYPE(PVM)        pVM;
    402402    /** Flag indicating the allocation method.
    403403     * Set: SUPLowAlloc().
     
    601601            R3PTRTYPE(void *)       pvR3;
    602602            /** Host context ring-0 pointer. */
     603            /** @todo #1865: Check if this actually works (doubt it) */
    603604            RTR0PTR                 pvR0;
    604605            /** Pointer to the locked mem record. */
     
    611612            /** Host context pointer. */
    612613            R3PTRTYPE(void *)       pvR3;
     614            /** @todo #1865: Add a pvR0 here! */
    613615            /** HC physical address corresponding to pvR3. */
    614616            RTHCPHYS                HCPhys;
  • trunk/src/VBox/VMM/PGMMap.cpp

    r12964 r12968  
    11221122 * @param   GCPtrSrc    The source address (GC virtual address).
    11231123 * @param   cb          Number of bytes to read.
     1124 *
     1125 * @remarks The is indirectly for DBGF only.
     1126 * @todo    Consider renaming it to indicate it's special usage, or just
     1127 *          reimplement it in MMR3HyperReadGCVirt.
    11241128 */
    11251129PGMR3DECL(int) PGMR3MapRead(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb)
  • trunk/src/VBox/VMM/VMMAll/MMAllHyper.cpp

    r12967 r12968  
    154154
    155155/**
    156  * Allocates memory in the Hypervisor (GC VMM) area.
     156 * Allocates memory in the Hypervisor (RC VMM) area.
    157157 * The returned memory is of course zeroed.
    158158 *
  • trunk/src/VBox/VMM/VMMAll/MMAllPagePool.cpp

    r12967 r12968  
    9595MMDECL(void *) mmPagePoolPhys2Ptr(PMMPAGEPOOL pPool, RTHCPHYS HCPhys)
    9696{
    97 #if 0 /** @todo have to fix the debugger, but until then this is going on my nevers. */
     97#if 0 /** @todo have to fix the debugger, but until then this is going on my nerves. */
    9898#ifdef IN_RING3
    9999    VM_ASSERT_EMT(pPool->pVM);
     
    221221    return VINF_SUCCESS;
    222222}
     223
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