VirtualBox

Changeset 17251 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 2, 2009 1:55:31 PM (16 years ago)
Author:
vboxsync
Message:

VMM,REM,DevPcArch: VBOX_WITH_NEW_PHYS_CODE changes.

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPcArch.c

    r12977 r17251  
    252252        return rc;
    253253
     254#ifndef VBOX_WITH_NEW_PHYS_CODE
    254255    /*
    255256     * Reserve ROM/MMIO areas:
     
    264265    if (RT_FAILURE(rc))
    265266        return rc;
     267#endif
    266268
    267269    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/MM.cpp

    r14299 r17251  
    500500VMMR3DECL(void) MMR3Reset(PVM pVM)
    501501{
     502#ifndef VBOX_WITH_NEW_PHYS_CODE
    502503    mmR3PhysRomReset(pVM);
     504#endif
    503505}
    504506
  • trunk/src/VBox/VMM/MMInternal.h

    r14597 r17251  
    565565
    566566
     567#ifndef VBOX_WITH_NEW_PHYS_CODE
    567568/**
    568569 * A registered Rom range.
     
    594595/** Pointer to a ROM range. */
    595596typedef MMROMRANGE *PMMROMRANGE;
     597#endif /* !VBOX_WITH_NEW_PHYS_CODE */
    596598
    597599
     
    765767    uint32_t                    cFixedPages;
    766768
     769#ifndef VBOX_WITH_NEW_PHYS_CODE
    767770    /** The head of the ROM ranges. */
    768771    R3PTRTYPE(PMMROMRANGE)      pRomHead;
     772#endif
    769773} MM;
    770774/** Pointer to MM Data (part of VM). */
     
    803807const char *mmR3GetTagName(MMTAG enmTag);
    804808
     809#ifndef VBOX_WITH_NEW_PHYS_CODE
    805810void mmR3PhysRomReset(PVM pVM);
     811#endif
    806812
    807813/**
  • trunk/src/VBox/VMM/MMPhys.cpp

    r13841 r17251  
    4141#include <iprt/string.h>
    4242
     43
     44/**
     45 * Get the size of the base RAM.
     46 * This usually means the size of the first contigous block of physical memory.
     47 *
     48 * @returns The guest base RAM size.
     49 * @param   pVM         The VM handle.
     50 * @thread  Any.
     51 */
     52VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM)
     53{
     54    return pVM->mm.s.cbRamBase;
     55}
     56
     57#ifndef VBOX_WITH_NEW_PHYS_CODE
    4358
    4459/**
     
    221236 */
    222237VMMR3DECL(int) MMR3PhysRomRegister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const void *pvBinary,
    223                                   bool fShadow, const char *pszDesc)
     238                                   bool fShadow, const char *pszDesc)
    224239{
    225240    /*
     
    401416    AssertRC(rc);
    402417
    403     REMR3NotifyPhysReserve(pVM, GCPhys, cbRange);
     418    REMR3NotifyPhysRamDeregister(pVM, GCPhys, cbRange);
    404419    return rc;
    405 }
    406 
    407 
    408 /**
    409  * Get the size of the base RAM.
    410  * This usually means the size of the first contigous block of physical memory.
    411  *
    412  * @returns The guest base RAM size.
    413  * @param   pVM         The VM handle.
    414  * @thread  Any.
    415  */
    416 VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM)
    417 {
    418     return pVM->mm.s.cbRamBase;
    419420}
    420421
     
    490491}
    491492
     493#endif /* !VBOX_WITH_NEW_PHYS_CODE */
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r15129 r17251  
    349349             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc, pszDesc));
    350350
     351#ifdef VBOX_WITH_NEW_PHYS_CODE
     352    uint32_t fFlags = 0;
     353    if (fShadow)
     354        fFlags |= PGMPHYS_ROM_FLAG_SHADOWED;
     355    /** @todo PGMPHYS_ROM_FLAG_PERMANENT_BINARY */
     356    int rc = PGMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fFlags, pszDesc);
     357#else
    351358    int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc);
     359#endif
    352360
    353361    LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc));
     
    21302138static DECLCALLBACK(int) pdmR3DevHlp_PhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc)
    21312139{
     2140#ifndef VBOX_WITH_NEW_PHYS_CODE
    21322141    PDMDEV_ASSERT_DEVINS(pDevIns);
    21332142    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
     
    21402149
    21412150    return rc;
     2151#else
     2152    AssertFailed();
     2153    return VERR_ACCESS_DENIED;
     2154#endif
    21422155}
    21432156
     
    25052518
    25062519/** @copydoc PDMDEVHLPR3::pfnROMProtectShadow */
    2507 static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
    2508 {
    2509     PDMDEV_ASSERT_DEVINS(pDevIns);
    2510     LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x\n",
    2511              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange));
    2512 
     2520static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
     2521{
     2522    PDMDEV_ASSERT_DEVINS(pDevIns);
     2523    LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x enmProt=%d\n",
     2524             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, enmProt));
     2525
     2526#ifdef VBOX_WITH_NEW_PHYS_CODE
     2527    int rc = PGMR3PhysRomProtect(pDevIns->Internal.s.pVMR3, GCPhysStart, cbRange, enmProt);
     2528#else
    25132529    int rc = MMR3PhysRomProtect(pDevIns->Internal.s.pVMR3, GCPhysStart, cbRange);
     2530#endif
    25142531
    25152532    LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc));
     
    30503067
    30513068/** @copydoc PDMDEVHLPR3::pfnROMProtectShadow */
    3052 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)
     3069static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
    30533070{
    30543071    PDMDEV_ASSERT_DEVINS(pDevIns);
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r16045 r17251  
    171171
    172172
    173 
    174173/**
    175174 * Sets up a range RAM.
     
    245244
    246245    pNew->pvR3          = NULL;
     246#ifndef VBOX_WITH_NEW_PHYS_CODE
    247247    pNew->paChunkR3Ptrs = NULL;
    248248
    249 #ifndef VBOX_WITH_NEW_PHYS_CODE
    250249    /* Allocate memory for chunk to HC ptr lookup array. */
    251250    rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->paChunkR3Ptrs);
     
    303302                    case PGMPAGETYPE_RAM:
    304303                        if (!PGM_PAGE_IS_ZERO(pPage))
    305                             pgmPhysFreePage(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)i << PAGE_SHIFT));
     304                            pgmPhysFreePage(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT));
    306305                        break;
    307306
     
    351350                            case PGM_PAGE_STATE_SHARED:
    352351                            case PGM_PAGE_STATE_WRITE_MONITORED:
    353                                 rc = pgmPhysPageMakeWritable(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)i << PAGE_SHIFT));
     352                                rc = pgmPhysPageMakeWritable(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT));
    354353                                AssertLogRelRCReturn(rc, rc);
    355354                            case PGM_PAGE_STATE_ALLOCATED:
     
    357356                                void *pvPage;
    358357                                PPGMPAGEMAP pMapIgnored;
    359                                 rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)i << PAGE_SHIFT), &pMapIgnored, &pvPage);
     358                                rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT), &pMapIgnored, &pvPage);
    360359                                AssertLogRelRCReturn(rc, rc);
    361360                                ASMMemZeroPage(pvPage);
     
    488487
    489488        pNew->pvR3          = NULL;
     489#ifndef VBOX_WITH_NEW_PHYS_CODE
    490490        pNew->paChunkR3Ptrs = NULL;
     491#endif
    491492
    492493        uint32_t iPage = cPages;
     
    701702
    702703            pNew->RamRange.pvR3 = pvPages;       ///@todo remove this [new phys code]
     704#ifndef VBOX_WITH_NEW_PHYS_CODE
    703705            pNew->RamRange.paChunkR3Ptrs = NULL; ///@todo remove this [new phys code]
     706#endif
    704707
    705708            uint32_t iPage = cPages;
     
    995998    else
    996999    {
    997         REMR3NotifyPhysReserve(pVM, pCur->RamRange.GCPhys, pCur->RamRange.cb);
     1000        REMR3NotifyPhysRamDeregister(pVM, pCur->RamRange.GCPhys, pCur->RamRange.cb);
    9981001        pgmR3PhysUnlinkRamRange(pVM, &pCur->RamRange);
    9991002    }
     
    15041507
    15051508
    1506 
    15071509/**
    15081510 * Called by PGMR3Reset to reset the shadow, switch to the virgin,
     
    16991701}
    17001702
     1703#ifndef VBOX_WITH_NEW_PHYS_CODE
    17011704
    17021705/**
     
    18511854}
    18521855
    1853 #ifndef VBOX_WITH_NEW_PHYS_CODE
    18541856
    18551857/**
     
    20502052
    20512053#endif /* !VBOX_WITH_NEW_PHYS_CODE */
    2052 
    20532054
    20542055/**
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