VirtualBox

Changeset 13215 in vbox


Ignore:
Timestamp:
Oct 13, 2008 1:29:00 PM (16 years ago)
Author:
vboxsync
Message:

PDM: adjusted the PCI Bus determination so that it checks whether the bus is actually there. (untested)

File:
1 edited

Legend:

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

    r13189 r13215  
    425425        /** @todo the PCI device vs. PDM device designed is a bit flawed if we have to
    426426         * support a PDM device with multiple PCI devices. This might become a problem
    427          * when upgrading the chipset for instance...
     427         * when upgrading the chipset for instance because of multiple functions in some
     428         * devices...
    428429         */
    429430        AssertMsgFailed(("Only one PCI device per device is currently implemented!\n"));
     
    433434    /*
    434435     * Choose the PCI bus for the device.
    435      * This is simple. If the device was configured for a particular bus,
    436      * the PCIBusNo configuration value will be set.
    437      * If not the default bus is 0.
    438      */
    439     uint8_t u8Bus;
     436     *
     437     * This is simple. If the device was configured for a particular bus, the PCIBusNo
     438     * configuration value will be set. If not the default bus is 0.
     439     */
    440440    int rc;
    441441    PPDMPCIBUS pBus = pDevIns->Internal.s.pPciBusR3;
    442 
    443     rc = CFGMR3QueryU8Def(pDevIns->Internal.s.pCfgHandle, "PCIBusNo", &u8Bus, 0);
    444 
    445     /* Sanity checks. */
    446     AssertMsgRCReturn(rc, ("Configuration error: PCIBusNo query failed with rc=%Vrc (%s/%d)\n",
    447                            rc, pDevIns->pDevReg->szDeviceName, pDevIns->iInstance), rc);
    448 
    449     AssertMsgReturn(u8Bus < RT_ELEMENTS(pVM->pdm.s.aPciBuses),
    450                     ("Configuration error: PCIBusNo=%d, max is %d. (%s/%d)\n", u8Bus,
    451                      RT_ELEMENTS(pVM->pdm.s.aPciBuses), pDevIns->pDevReg->szDeviceName,
    452                      pDevIns->iInstance),
    453                     VERR_INTERNAL_ERROR);
    454 
    455     pBus = pDevIns->Internal.s.pPciBusR3 = &pVM->pdm.s.aPciBuses[u8Bus];
    456     if (pBus)
     442    if (!pBus)
     443    {
     444        uint8_t u8Bus;
     445        rc = CFGMR3QueryU8Def(pDevIns->Internal.s.pCfgHandle, "PCIBusNo", &u8Bus, 0);
     446        AssertLogRelMsgRCReturn(rc, ("Configuration error: PCIBusNo query failed with rc=%Rrc (%s/%d)\n",
     447                                     rc, pDevIns->pDevReg->szDeviceName, pDevIns->iInstance), rc);
     448        AssertLogRelMsgReturn(u8Bus < RT_ELEMENTS(pVM->pdm.s.aPciBuses),
     449                              ("Configuration error: PCIBusNo=%d, max is %d. (%s/%d)\n", u8Bus,
     450                               RT_ELEMENTS(pVM->pdm.s.aPciBuses), pDevIns->pDevReg->szDeviceName, pDevIns->iInstance),
     451                              VERR_PDM_NO_PCI_BUS);
     452        pBus = pDevIns->Internal.s.pPciBusR3 = &pVM->pdm.s.aPciBuses[u8Bus];
     453    }
     454    if (pBus->pDevInsR3)
    457455    {
    458456        if (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_RC)
     
    531529    else
    532530    {
    533         AssertMsgFailed(("Configuration error: No PCI bus available. This could be related to init order too!\n"));
     531        AssertLogRelMsgFailed(("Configuration error: No PCI bus available. This could be related to init order too!\n"));
    534532        rc = VERR_PDM_NO_PCI_BUS;
    535533    }
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