Changeset 17251 in vbox for trunk/src/VBox
- Timestamp:
- Mar 2, 2009 1:55:31 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPcArch.c
r12977 r17251 252 252 return rc; 253 253 254 #ifndef VBOX_WITH_NEW_PHYS_CODE 254 255 /* 255 256 * Reserve ROM/MMIO areas: … … 264 265 if (RT_FAILURE(rc)) 265 266 return rc; 267 #endif 266 268 267 269 return VINF_SUCCESS; -
trunk/src/VBox/VMM/MM.cpp
r14299 r17251 500 500 VMMR3DECL(void) MMR3Reset(PVM pVM) 501 501 { 502 #ifndef VBOX_WITH_NEW_PHYS_CODE 502 503 mmR3PhysRomReset(pVM); 504 #endif 503 505 } 504 506 -
trunk/src/VBox/VMM/MMInternal.h
r14597 r17251 565 565 566 566 567 #ifndef VBOX_WITH_NEW_PHYS_CODE 567 568 /** 568 569 * A registered Rom range. … … 594 595 /** Pointer to a ROM range. */ 595 596 typedef MMROMRANGE *PMMROMRANGE; 597 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 596 598 597 599 … … 765 767 uint32_t cFixedPages; 766 768 769 #ifndef VBOX_WITH_NEW_PHYS_CODE 767 770 /** The head of the ROM ranges. */ 768 771 R3PTRTYPE(PMMROMRANGE) pRomHead; 772 #endif 769 773 } MM; 770 774 /** Pointer to MM Data (part of VM). */ … … 803 807 const char *mmR3GetTagName(MMTAG enmTag); 804 808 809 #ifndef VBOX_WITH_NEW_PHYS_CODE 805 810 void mmR3PhysRomReset(PVM pVM); 811 #endif 806 812 807 813 /** -
trunk/src/VBox/VMM/MMPhys.cpp
r13841 r17251 41 41 #include <iprt/string.h> 42 42 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 */ 52 VMMR3DECL(uint64_t) MMR3PhysGetRamSize(PVM pVM) 53 { 54 return pVM->mm.s.cbRamBase; 55 } 56 57 #ifndef VBOX_WITH_NEW_PHYS_CODE 43 58 44 59 /** … … 221 236 */ 222 237 VMMR3DECL(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) 224 239 { 225 240 /* … … 401 416 AssertRC(rc); 402 417 403 REMR3NotifyPhysR eserve(pVM, GCPhys, cbRange);418 REMR3NotifyPhysRamDeregister(pVM, GCPhys, cbRange); 404 419 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;419 420 } 420 421 … … 490 491 } 491 492 493 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ -
trunk/src/VBox/VMM/PDMDevHlp.cpp
r15129 r17251 349 349 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc, pszDesc)); 350 350 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 351 358 int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc); 359 #endif 352 360 353 361 LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 2130 2138 static DECLCALLBACK(int) pdmR3DevHlp_PhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc) 2131 2139 { 2140 #ifndef VBOX_WITH_NEW_PHYS_CODE 2132 2141 PDMDEV_ASSERT_DEVINS(pDevIns); 2133 2142 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); … … 2140 2149 2141 2150 return rc; 2151 #else 2152 AssertFailed(); 2153 return VERR_ACCESS_DENIED; 2154 #endif 2142 2155 } 2143 2156 … … 2505 2518 2506 2519 /** @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 2520 static 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 2513 2529 int rc = MMR3PhysRomProtect(pDevIns->Internal.s.pVMR3, GCPhysStart, cbRange); 2530 #endif 2514 2531 2515 2532 LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: returns %Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); … … 3050 3067 3051 3068 /** @copydoc PDMDEVHLPR3::pfnROMProtectShadow */ 3052 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange )3069 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt) 3053 3070 { 3054 3071 PDMDEV_ASSERT_DEVINS(pDevIns); -
trunk/src/VBox/VMM/PGMPhys.cpp
r16045 r17251 171 171 172 172 173 174 173 /** 175 174 * Sets up a range RAM. … … 245 244 246 245 pNew->pvR3 = NULL; 246 #ifndef VBOX_WITH_NEW_PHYS_CODE 247 247 pNew->paChunkR3Ptrs = NULL; 248 248 249 #ifndef VBOX_WITH_NEW_PHYS_CODE250 249 /* Allocate memory for chunk to HC ptr lookup array. */ 251 250 rc = MMHyperAlloc(pVM, (cb >> PGM_DYNAMIC_CHUNK_SHIFT) * sizeof(void *), 16, MM_TAG_PGM, (void **)&pNew->paChunkR3Ptrs); … … 303 302 case PGMPAGETYPE_RAM: 304 303 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)); 306 305 break; 307 306 … … 351 350 case PGM_PAGE_STATE_SHARED: 352 351 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)); 354 353 AssertLogRelRCReturn(rc, rc); 355 354 case PGM_PAGE_STATE_ALLOCATED: … … 357 356 void *pvPage; 358 357 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); 360 359 AssertLogRelRCReturn(rc, rc); 361 360 ASMMemZeroPage(pvPage); … … 488 487 489 488 pNew->pvR3 = NULL; 489 #ifndef VBOX_WITH_NEW_PHYS_CODE 490 490 pNew->paChunkR3Ptrs = NULL; 491 #endif 491 492 492 493 uint32_t iPage = cPages; … … 701 702 702 703 pNew->RamRange.pvR3 = pvPages; ///@todo remove this [new phys code] 704 #ifndef VBOX_WITH_NEW_PHYS_CODE 703 705 pNew->RamRange.paChunkR3Ptrs = NULL; ///@todo remove this [new phys code] 706 #endif 704 707 705 708 uint32_t iPage = cPages; … … 995 998 else 996 999 { 997 REMR3NotifyPhysR eserve(pVM, pCur->RamRange.GCPhys, pCur->RamRange.cb);1000 REMR3NotifyPhysRamDeregister(pVM, pCur->RamRange.GCPhys, pCur->RamRange.cb); 998 1001 pgmR3PhysUnlinkRamRange(pVM, &pCur->RamRange); 999 1002 } … … 1504 1507 1505 1508 1506 1507 1509 /** 1508 1510 * Called by PGMR3Reset to reset the shadow, switch to the virgin, … … 1699 1701 } 1700 1702 1703 #ifndef VBOX_WITH_NEW_PHYS_CODE 1701 1704 1702 1705 /** … … 1851 1854 } 1852 1855 1853 #ifndef VBOX_WITH_NEW_PHYS_CODE1854 1856 1855 1857 /** … … 2050 2052 2051 2053 #endif /* !VBOX_WITH_NEW_PHYS_CODE */ 2052 2053 2054 2054 2055 /**
Note:
See TracChangeset
for help on using the changeset viewer.