Changeset 13215 in vbox
- Timestamp:
- Oct 13, 2008 1:29:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMDevHlp.cpp
r13189 r13215 425 425 /** @todo the PCI device vs. PDM device designed is a bit flawed if we have to 426 426 * 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... 428 429 */ 429 430 AssertMsgFailed(("Only one PCI device per device is currently implemented!\n")); … … 433 434 /* 434 435 * 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 */ 440 440 int rc; 441 441 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) 457 455 { 458 456 if (pDevIns->pDevReg->fFlags & PDM_DEVREG_FLAGS_RC) … … 531 529 else 532 530 { 533 Assert MsgFailed(("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")); 534 532 rc = VERR_PDM_NO_PCI_BUS; 535 533 }
Note:
See TracChangeset
for help on using the changeset viewer.