VirtualBox

Changeset 33203 in vbox


Ignore:
Timestamp:
Oct 18, 2010 2:55:53 PM (14 years ago)
Author:
vboxsync
Message:

PCI: tight packing of builting devices into functions, chipset slot assignment has higher priority than device now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r33142 r33203  
    18801880        "piix3ide", 31, 1 /* IDE controller */
    18811881    },
    1882 #if 0
     1882    /* Disable, if we may wish to have multiple AHCI controllers */
     1883#if 1
    18831884    {
    18841885        "ahci",     31, 2 /* SATA controller */
     
    18891890    },
    18901891    {
     1892        "usb-ohci", 31, 4 /* OHCI USB controller */
     1893    },
     1894    {
     1895        "usb-ehci", 31, 5 /* EHCI USB controller */
     1896    },
     1897    {
    18911898        "thermal",  31, 6 /* Thermal controller */
    18921899    },
    18931900};
    18941901
    1895 static int assignPosition(PPCIBUS pBus, PPCIDEVICE pPciDev, const char *pszName)
     1902static int assignPosition(PPCIBUS pBus, PPCIDEVICE pPciDev, const char *pszName, int iDevFn)
    18961903{
    18971904    /* Hardcoded slots/functions, per chipset spec */
     
    19041911        }
    19051912    }
     1913
     1914    if (iDevFn >=0 && iDevFn < (int)RT_ELEMENTS(pBus->apDevices))
     1915        return iDevFn;
    19061916
    19071917    /* Otherwise when assigning a slot, we need to make sure all its functions are available */
     
    19451955     * Find device position
    19461956     */
    1947     if (iDev < 0 || !strcmp(pszName, "piix3ide"))
    1948     {
    1949         iDev = assignPosition(pBus, pPciDev, pszName);
    1950         if (iDev < 0)
    1951         {
    1952              AssertMsgFailed(("Couldn't find free spot!\n"));
    1953              return VERR_PDM_TOO_PCI_MANY_DEVICES;
    1954         }
     1957    iDev = assignPosition(pBus, pPciDev, pszName, iDev);
     1958    if (iDev < 0)
     1959    {
     1960        AssertMsgFailed(("Couldn't find free spot!\n"));
     1961        return VERR_PDM_TOO_PCI_MANY_DEVICES;
    19551962    }
    19561963
     
    19711978    {
    19721979        /* if we got here, we shall (and usually can) relocate the device */
    1973         int iRelDev = assignPosition(pBus, pBus->apDevices[iDev], pBus->apDevices[iDev]->name);
     1980        int iRelDev = assignPosition(pBus, pBus->apDevices[iDev], pBus->apDevices[iDev]->name, -1);
    19741981        if (iRelDev < 0 || iRelDev == iDev)
    19751982        {
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