VirtualBox

Changeset 64844 in vbox


Ignore:
Timestamp:
Dec 12, 2016 8:30:09 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112238
Message:

PDMPCIDEVREG_DEV_NO_SAME_AS_PREV: Include default bus number.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmdev.h

    r64696 r64844  
    18571857/** Use the next device configuration number in the sequence (max + 1). */
    18581858# define PDMPCIDEVREG_CFG_NEXT              UINT32_MAX
    1859 /** Same device number as the previous PCI device registered with the PDM device.
    1860  * This is handy when registering multiple PCI device functions and the device
    1861  * number is left up to the PCI bus.  In order to facilitate on PDM device
    1862  * instance for each PCI function, this searches earlier PDM device
    1863  * instances as well. */
     1859/** Same device number (and bus) as the previous PCI device registered with the PDM device.
     1860 * This is handy when registering multiple PCI device functions and the device  number
     1861 * is left up to the PCI bus.  In order to facilitate on PDM device instance for each
     1862 * PCI function, this searches earlier PDM device  instances as well. */
    18641863# define PDMPCIDEVREG_DEV_NO_SAME_AS_PREV   UINT8_C(0xfd)
    18651864/** Use the first unused device number (all functions must be unused). */
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r64696 r64844  
    12971297     */
    12981298    uint8_t const uPciDevNoRaw = uPciDevNo;
     1299    uint32_t      uDefPciBusNo = 0;
    12991300    if (uPciDevNo == PDMPCIDEVREG_DEV_NO_SAME_AS_PREV)
    13001301    {
    13011302        if (pPrevPciDev)
    1302             uPciDevNo = pPrevPciDev->uDevFn >> 3;
     1303        {
     1304            uPciDevNo    = pPrevPciDev->uDevFn >> 3;
     1305            uDefPciBusNo = pPrevPciDev->Int.s.pPdmBusR3->iBus;
     1306        }
    13031307        else
    13041308        {
     
    13201324            while (pOtherPciDev->Int.s.pNextR3)
    13211325                pOtherPciDev = pOtherPciDev->Int.s.pNextR3;
    1322             uPciDevNo = pOtherPciDev->uDevFn >> 3;
     1326            uPciDevNo    = pOtherPciDev->uDevFn >> 3;
     1327            uDefPciBusNo = pOtherPciDev->Int.s.pPdmBusR3->iBus;
    13231328        }
    13241329    }
     
    13311336     */
    13321337    /** @cfgm{/Devices/NAME/XX/[PciCfgYY/]PCIBusNo, uint8_t, 0, 7, 0}
    1333      * Selects the PCI bus number of a device.
     1338     * Selects the PCI bus number of a device.  The default value isn't necessarily
     1339     * zero if the device is registered using PDMPCIDEVREG_DEV_NO_SAME_AS_PREV, it
     1340     * will then also inherit the bus number from the previously registered device.
    13341341     */
    13351342    uint8_t u8Bus;
    1336     int rc = CFGMR3QueryU8Def(pCfg, "PCIBusNo", &u8Bus, 0);
     1343    int rc = CFGMR3QueryU8Def(pCfg, "PCIBusNo", &u8Bus, (uint8_t)uDefPciBusNo);
    13371344    AssertLogRelMsgRCReturn(rc, ("Configuration error: PCIBusNo query failed with rc=%Rrc (%s/%d)\n",
    13381345                                 rc, pDevIns->pReg->szName, pDevIns->iInstance), rc);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette