VirtualBox

Changeset 4382 in vbox for trunk/src


Ignore:
Timestamp:
Aug 27, 2007 11:28:55 AM (17 years ago)
Author:
vboxsync
Message:

Extended the ROMRegister DevHlp interface to include a fShadow flag. Added a interface intented for write proecting shadow ROM after the POST is over.

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r4333 r4382  
    47354735    AssertReleaseMsg(g_cbVgaBiosBinary <= _64K && g_cbVgaBiosBinary >= 32*_1K, ("g_cbVgaBiosBinary=%#x\n", g_cbVgaBiosBinary));
    47364736    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");
    47384739    if (VBOX_FAILURE(rc))
    47394740        return rc;
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r4279 r4382  
    15611561        return rc;
    15621562
    1563     rc = PDMDevHlpROMRegister (pDevIns, rsdp_addr, 0x1000, s->au8RSDPPage, "ACPI RSDP");
     1563    rc = PDMDevHlpROMRegister (pDevIns, rsdp_addr, 0x1000, s->au8RSDPPage, false /* fShadow */, "ACPI RSDP");
    15641564    if (VBOX_FAILURE (rc))
    15651565        return rc;
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r4071 r4382  
    11461146        pcbiosPlantMPStable(pDevIns, pData->au8DMIPage + 0x100);
    11471147
    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");
    11491149    if (VBOX_FAILURE(rc))
    11501150        return rc;
     
    11611161                     ("g_cbPcBiosBinary=%#x\n", g_cbPcBiosBinary));
    11621162    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");
    11651165    if (VBOX_FAILURE(rc))
    11661166        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");
    11691169    if (VBOX_FAILURE(rc))
    11701170        return rc;
     
    13991399     */
    14001400    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");
    14021403
    14031404    rc = CFGMR3QueryU8(pCfgHandle, "DelayBoot", &pData->uBootDelay);
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r4071 r4382  
    9696                                           const char *pszDesc);
    9797static 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);
     98static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc);
    9999static DECLCALLBACK(int) pdmR3DevHlp_SSMRegister(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess,
    100100                                        PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone,
     
    163163static DECLCALLBACK(void) pdmR3DevHlp_GetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf,
    164164                                               uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx);
     165static DECLCALLBACK(int) pdmR3DevHlp_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange);
    165166
    166167static DECLCALLBACK(PVM) pdmR3DevHlp_Untrusted_GetVM(PPDMDEVINS pDevIns);
     
    195196static DECLCALLBACK(void) pdmR3DevHlp_Untrusted_QueryCPUId(PPDMDEVINS pDevIns, uint32_t iLeaf,
    196197                                                           uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx);
    197 
     198static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_ROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange);
    198199/** @} */
    199200
     
    358359    pdmR3DevHlp_CMOSRead,
    359360    pdmR3DevHlp_GetCpuId,
     361    pdmR3DevHlp_ROMProtectShadow,
    360362    PDM_DEVHLP_VERSION /* the end */
    361363};
     
    446448    pdmR3DevHlp_Untrusted_CMOSRead,
    447449    pdmR3DevHlp_Untrusted_QueryCPUId,
     450    pdmR3DevHlp_Untrusted_ROMProtectShadow,
    448451    PDM_DEVHLP_VERSION /* the end */
    449452};
     
    14781481
    14791482/** @copydoc PDMDEVHLP::pfnROMRegister */
    1480 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, const char *pszDesc)
     1483static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc)
    14811484{
    14821485    PDMDEV_ASSERT_DEVINS(pDevIns);
    14831486    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
     1490AssertReturn(!fShadow, VERR_NOT_IMPLEMENTED); /* be patient. */
    14871491    int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMHC, pDevIns, GCPhysStart, cbRange, pvBinary, pszDesc);
    14881492
     
    35873591
    35883592
     3593/** @copydoc PDMDEVHLP::pfnROMProtectShadow */
     3594static 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
     3600AssertFailed(); /* 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
    35893607
    35903608
     
    38863904    PDMDEV_ASSERT_DEVINS(pDevIns);
    38873905    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance));
     3906}
     3907
     3908
     3909/** @copydoc PDMDEVHLP::pfnROMProtectShadow */
     3910static 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;
    38883915}
    38893916
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