- Timestamp:
- Aug 27, 2007 11:28:55 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmdev.h
r4071 r4382 1791 1791 * @param pvBinary Pointer to the binary data backing the ROM image. 1792 1792 * This must be cbRange bytes big. 1793 * It will be copied and doesn't have to stick around. 1793 * It will be copied and doesn't have to stick around if fShadow is clear. 1794 * @param fShadow Whether to emulate ROM shadowing. This involves leaving 1795 * the ROM writable for a while during the POST and refreshing 1796 * it at reset. When this flag is set, the memory pointed to by 1797 * pvBinary has to stick around for the lifespan of the VM. 1794 1798 * @param pszDesc Pointer to description string. This must not be freed. 1799 * 1795 1800 * @remark There is no way to remove the rom, automatically on device cleanup or 1796 1801 * manually from the device yet. At present I doubt we need such features... 1797 1802 */ 1798 DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, const char *pszDesc));1803 DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc)); 1799 1804 1800 1805 /** … … 2527 2532 DECLR3CALLBACKMEMBER(void, pfnGetCpuId,(PPDMDEVINS pDevIns, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)); 2528 2533 2534 /** 2535 * Write protects a shadow ROM mapping. 2536 * 2537 * This is intented for use by the system BIOS or by the device that 2538 * employs a shadow ROM BIOS, so that the shadow ROM mapping can be 2539 * write protected once the POST is over. 2540 * 2541 * @param pDevIns Device instance. 2542 * @param GCPhysStart Where the shadow ROM mapping starts. 2543 * @param cbRange The size of the shadow ROM mapping. 2544 */ 2545 DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)); 2546 2529 2547 /** @} */ 2530 2548 2531 /** Just a safety precaution. ( The value is 0.) */2549 /** Just a safety precaution. (PDM_DEVHLP_VERSION) */ 2532 2550 uint32_t u32TheEnd; 2533 2551 } PDMDEVHLP; … … 2539 2557 2540 2558 /** Current PDMDEVHLP version number. */ 2541 #define PDM_DEVHLP_VERSION 0xf20 400002559 #define PDM_DEVHLP_VERSION 0xf2050000 2542 2560 2543 2561 … … 2998 3016 * @copydoc PDMDEVHLP::pfnROMRegister 2999 3017 */ 3000 DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, const char *pszDesc) 3001 { 3002 return pDevIns->pDevHlp->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, pszDesc); 3018 DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc) 3019 { 3020 return pDevIns->pDevHlp->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc); 3021 } 3022 3023 /** 3024 * @copydoc PDMDEVHLP::pfnROMProtectShadow 3025 */ 3026 DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange) 3027 { 3028 return pDevIns->pDevHlp->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange); 3003 3029 } 3004 3030 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r4333 r4382 4735 4735 AssertReleaseMsg(g_cbVgaBiosBinary <= _64K && g_cbVgaBiosBinary >= 32*_1K, ("g_cbVgaBiosBinary=%#x\n", g_cbVgaBiosBinary)); 4736 4736 AssertReleaseMsg(RT_ALIGN_Z(g_cbVgaBiosBinary, PAGE_SIZE) == g_cbVgaBiosBinary, ("g_cbVgaBiosBinary=%#x\n", g_cbVgaBiosBinary)); 4737 rc = PDMDevHlpROMRegister(pDevIns, 0x000c0000, g_cbVgaBiosBinary, &g_abVgaBiosBinary[0], "VGA BIOS"); 4737 rc = PDMDevHlpROMRegister(pDevIns, 0x000c0000, g_cbVgaBiosBinary, &g_abVgaBiosBinary[0], 4738 false /* fShadow */, "VGA BIOS"); 4738 4739 if (VBOX_FAILURE(rc)) 4739 4740 return rc; -
trunk/src/VBox/Devices/PC/DevACPI.cpp
r4279 r4382 1561 1561 return rc; 1562 1562 1563 rc = PDMDevHlpROMRegister (pDevIns, rsdp_addr, 0x1000, s->au8RSDPPage, "ACPI RSDP");1563 rc = PDMDevHlpROMRegister (pDevIns, rsdp_addr, 0x1000, s->au8RSDPPage, false /* fShadow */, "ACPI RSDP"); 1564 1564 if (VBOX_FAILURE (rc)) 1565 1565 return rc; -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r4071 r4382 1146 1146 pcbiosPlantMPStable(pDevIns, pData->au8DMIPage + 0x100); 1147 1147 1148 rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, 0x1000, pData->au8DMIPage, "DMI tables");1148 rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, 0x1000, pData->au8DMIPage, false /* fShadow */, "DMI tables"); 1149 1149 if (VBOX_FAILURE(rc)) 1150 1150 return rc; … … 1161 1161 ("g_cbPcBiosBinary=%#x\n", g_cbPcBiosBinary)); 1162 1162 cb = RT_MIN(g_cbPcBiosBinary, 128 * _1K); 1163 rc = PDMDevHlpROMRegister(pDevIns, 0x00100000 - cb, cb, 1164 &g_abPcBiosBinary[g_cbPcBiosBinary - cb], "PC BIOS - 0xfffff");1163 rc = PDMDevHlpROMRegister(pDevIns, 0x00100000 - cb, cb, &g_abPcBiosBinary[g_cbPcBiosBinary - cb], 1164 false /* fShadow */, "PC BIOS - 0xfffff"); 1165 1165 if (VBOX_FAILURE(rc)) 1166 1166 return rc; 1167 rc = PDMDevHlpROMRegister(pDevIns, (uint32_t)-g_cbPcBiosBinary, g_cbPcBiosBinary, 1168 &g_abPcBiosBinary[0], "PC BIOS - 0xffffffff");1167 rc = PDMDevHlpROMRegister(pDevIns, (uint32_t)-g_cbPcBiosBinary, g_cbPcBiosBinary, &g_abPcBiosBinary[0], 1168 false /* fShadow */, "PC BIOS - 0xffffffff"); 1169 1169 if (VBOX_FAILURE(rc)) 1170 1170 return rc; … … 1399 1399 */ 1400 1400 if (pu8LanBoot) 1401 rc = PDMDevHlpROMRegister(pDevIns, VBOX_LANBOOT_SEG << 4, cbFileLanBoot, pu8LanBoot, "Net Boot ROM"); 1401 rc = PDMDevHlpROMRegister(pDevIns, VBOX_LANBOOT_SEG << 4, cbFileLanBoot, pu8LanBoot, 1402 false /* fShadow */, "Net Boot ROM"); 1402 1403 1403 1404 rc = CFGMR3QueryU8(pCfgHandle, "DelayBoot", &pData->uBootDelay); -
trunk/src/VBox/VMM/PDMDevice.cpp
r4071 r4382 96 96 const char *pszDesc); 97 97 static DECLCALLBACK(int) pdmR3DevHlp_MMIODeregister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange); 98 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, const char *pszDesc);98 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc); 99 99 static DECLCALLBACK(int) pdmR3DevHlp_SSMRegister(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess, 100 100 PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone, … … 163 163 static DECLCALLBACK(void) pdmR3DevHlp_GetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf, 164 164 uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx); 165 static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange); 165 166 166 167 static DECLCALLBACK(PVM) pdmR3DevHlp_Untrusted_GetVM(PPDMDEVINS pDevIns); … … 195 196 static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_QueryCPUId(PPDMDEVINS pDevIns, uint32_t iLeaf, 196 197 uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx); 197 198 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange); 198 199 /** @} */ 199 200 … … 358 359 pdmR3DevHlp_CMOSRead, 359 360 pdmR3DevHlp_GetCpuId, 361 pdmR3DevHlp_ROMProtectShadow, 360 362 PDM_DEVHLP_VERSION /* the end */ 361 363 }; … … 446 448 pdmR3DevHlp_Untrusted_CMOSRead, 447 449 pdmR3DevHlp_Untrusted_QueryCPUId, 450 pdmR3DevHlp_Untrusted_ROMProtectShadow, 448 451 PDM_DEVHLP_VERSION /* the end */ 449 452 }; … … 1478 1481 1479 1482 /** @copydoc PDMDEVHLP::pfnROMRegister */ 1480 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, const char *pszDesc)1483 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc) 1481 1484 { 1482 1485 PDMDEV_ASSERT_DEVINS(pDevIns); 1483 1486 VM_ASSERT_EMT(pDevIns->Internal.s.pVMHC); 1484 LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x pvBinary=%p pszDesc=%p:{%s}\n", 1485 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, pszDesc, pszDesc)); 1486 1487 LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x pvBinary=%p fShadow=%RTbool pszDesc=%p:{%s}\n", 1488 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc, pszDesc)); 1489 1490 AssertReturn(!fShadow, VERR_NOT_IMPLEMENTED); /* be patient. */ 1487 1491 int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMHC, pDevIns, GCPhysStart, cbRange, pvBinary, pszDesc); 1488 1492 … … 3587 3591 3588 3592 3593 /** @copydoc PDMDEVHLP::pfnROMProtectShadow */ 3594 static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange) 3595 { 3596 PDMDEV_ASSERT_DEVINS(pDevIns); 3597 LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x\n", 3598 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange)); 3599 3600 AssertFailed(); /* be patient. */ 3601 int rc = VERR_NOT_IMPLEMENTED; 3602 3603 LogFlow(("pdmR3DevHlp_ROMProtectShadow: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); 3604 return rc; 3605 } 3606 3589 3607 3590 3608 … … 3886 3904 PDMDEV_ASSERT_DEVINS(pDevIns); 3887 3905 AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance)); 3906 } 3907 3908 3909 /** @copydoc PDMDEVHLP::pfnROMProtectShadow */ 3910 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange) 3911 { 3912 PDMDEV_ASSERT_DEVINS(pDevIns); 3913 AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance)); 3914 return VERR_ACCESS_DENIED; 3888 3915 } 3889 3916
Note:
See TracChangeset
for help on using the changeset viewer.