VirtualBox

Changeset 32820 in vbox for trunk/src/VBox/VMM/PDMDevHlp.cpp


Ignore:
Timestamp:
Sep 29, 2010 4:25:16 PM (14 years ago)
Author:
vboxsync
Message:

PCI, PDM: initial drop of MSI support

File:
1 edited

Legend:

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

    r32190 r32820  
    12931293
    12941294
     1295/** @interface_method_impl{PDMDEVHLPR3,pfnPCIRegisterMsi} */
     1296static DECLCALLBACK(int) pdmR3DevHlp_PCIRegisterMsi(PPDMDEVINS pDevIns, PPDMMSIREG pMsiReg)
     1297{
     1298    PDMDEV_ASSERT_DEVINS(pDevIns);
     1299    LogFlow(("pdmR3DevHlp_PCIRegisterMsi: caller='%s'/%d: %d vectors\n", pDevIns->pReg->szName, pDevIns->iInstance, pMsiReg->cVectors));
     1300    int rc = VINF_SUCCESS;
     1301
     1302    /*
     1303     * Must have a PCI device registered!
     1304     */
     1305    PPCIDEVICE pPciDev = pDevIns->Internal.s.pPciDeviceR3;
     1306    if (pPciDev)
     1307    {
     1308        PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3; /** @todo the bus should be associated with the PCI device not the PDM device. */
     1309        Assert(pBus);
     1310
     1311        PVM pVM = pDevIns->Internal.s.pVMR3;
     1312        pdmLock(pVM);
     1313        if (!pBus->pfnRegisterMsiR3)
     1314            rc = VERR_NOT_IMPLEMENTED;
     1315        else
     1316            rc = pBus->pfnRegisterMsiR3(pBus->pDevInsR3, pPciDev, pMsiReg);
     1317        pdmUnlock(pVM);
     1318    }
     1319    else
     1320        AssertReleaseMsgFailed(("No PCI device registered!\n"));
     1321
     1322    LogFlow(("pdmR3DevHlp_PCISetIrq: caller='%s'/%d: returns void\n", pDevIns->pReg->szName, pDevIns->iInstance));
     1323    return rc;
     1324}
     1325
    12951326/** @interface_method_impl{PDMDEVHLPR3,pfnISASetIrq} */
    12961327static DECLCALLBACK(void) pdmR3DevHlp_ISASetIrq(PPDMDEVINS pDevIns, int iIrq, int iLevel)
     
    20422073    pPciBus->pDevInsR3               = pDevIns;
    20432074    pPciBus->pfnRegisterR3           = pPciBusReg->pfnRegisterR3;
     2075    pPciBus->pfnRegisterMsiR3        = pPciBusReg->pfnRegisterMsiR3;
    20442076    pPciBus->pfnIORegionRegisterR3   = pPciBusReg->pfnIORegionRegisterR3;
    20452077    pPciBus->pfnSetConfigCallbacksR3 = pPciBusReg->pfnSetConfigCallbacksR3;
     
    30153047    pdmR3DevHlp_STAMRegisterV,
    30163048    pdmR3DevHlp_PCIRegister,
     3049    pdmR3DevHlp_PCIRegisterMsi,
    30173050    pdmR3DevHlp_PCIIORegionRegister,
    30183051    pdmR3DevHlp_PCISetConfigCallbacks,
     
    32213254    pdmR3DevHlp_STAMRegisterV,
    32223255    pdmR3DevHlp_PCIRegister,
     3256    pdmR3DevHlp_PCIRegisterMsi,
    32233257    pdmR3DevHlp_PCIIORegionRegister,
    32243258    pdmR3DevHlp_PCISetConfigCallbacks,
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