VirtualBox

Changeset 33606 in vbox


Ignore:
Timestamp:
Oct 29, 2010 1:46:48 PM (14 years ago)
Author:
vboxsync
Message:

PCI: add 2 bridges into ICH-9 chipset, more verbose topology printing

Location:
trunk/src/VBox
Files:
2 edited

Legend:

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

    r33540 r33606  
    20202020        return true;
    20212021
     2022    int iStartPos = 0;
     2023
     2024    /* We add bridges starting slot 22 */
     2025    if (!strcmp(pszName, "ich9pcibridge"))
     2026    {
     2027        iStartPos = 22 * 8;
     2028    }
     2029
    20222030    /* Otherwise when assigning a slot, we need to make sure all its functions are available */
    2023     for (int iPos = 0; iPos < (int)RT_ELEMENTS(pBus->apDevices); iPos += 8)
     2031    for (int iPos = iStartPos; iPos < (int)RT_ELEMENTS(pBus->apDevices); iPos += 8)
    20242032    {
    20252033        if (        !pBus->apDevices[iPos]
     
    21392147}
    21402148
     2149static void printIndent(PCDBGFINFOHLP pHlp, int iIndent)
     2150{
     2151    for (int i = 0; i < iIndent; i++)
     2152    {
     2153        pHlp->pfnPrintf(pHlp, "    ");
     2154    }
     2155}
     2156
     2157static void ich9pciBusInfo(PPCIBUS pBus, PCDBGFINFOHLP pHlp, int iIndent)
     2158{
     2159    for (uint32_t iDev = 0; iDev < RT_ELEMENTS(pBus->apDevices); iDev++)
     2160    {
     2161        PPCIDEVICE pPciDev = pBus->apDevices[iDev];
     2162        if (pPciDev != NULL)
     2163        {
     2164            printIndent(pHlp, iIndent);
     2165            pHlp->pfnPrintf(pHlp, "%02x:%02x:%02x %s: %04x-%04x%s%s\n",
     2166                            pBus->iBus, (iDev >> 3) & 0xff, iDev & 0x7,
     2167                            pPciDev->name,
     2168                            PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev),
     2169                            PCIIsMsiCapable(pPciDev)  ? " MSI" : "",
     2170                            PCIIsMsixCapable(pPciDev) ? " MSI-X" : ""
     2171                            );
     2172        }
     2173    }
     2174
     2175    if (pBus->cBridges > 0)
     2176    {
     2177        printIndent(pHlp, iIndent);
     2178        pHlp->pfnPrintf(pHlp, "Registered %d bridges, subordinate buses info follows\n", pBus->cBridges);
     2179        for (uint32_t iBridge = 0; iBridge < pBus->cBridges; iBridge++)
     2180        {
     2181            PPCIBUS pBusSub = PDMINS_2_DATA(pBus->papBridgesR3[iBridge]->pDevIns, PPCIBUS);
     2182            ich9pciBusInfo(pBusSub, pHlp, iIndent + 1);
     2183        }
     2184    }
     2185}
    21412186
    21422187/**
     
    21502195{
    21512196    PPCIBUS pBus = DEVINS_2_PCIBUS(pDevIns);
    2152     uint32_t iBus = 0, iDev;
    2153 
    2154 
    2155     for (iDev = 0; iDev < RT_ELEMENTS(pBus->apDevices); iDev++)
    2156     {
    2157         PPCIDEVICE pPciDev = pBus->apDevices[iDev];
    2158         if (pPciDev != NULL)
    2159             pHlp->pfnPrintf(pHlp, "%02x:%02x:%02x %s: %x-%x\n",
    2160                             iBus, (iDev >> 3) & 0xff, iDev & 0x7,
    2161                             pPciDev->name,
    2162                             PCIDevGetVendorId(pPciDev), PCIDevGetDeviceId(pPciDev)
    2163                             );
    2164     }
     2197
     2198    ich9pciBusInfo(pBus, pHlp, 0);
    21652199}
    21662200
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r33595 r33606  
    870870        if (chipsetType == ChipsetType_ICH9)
    871871        {
     872            /* Provide MCFG info */
    872873            InsertConfigInteger(pCfg,  "McfgBase",   u64McfgBase);
    873874            InsertConfigInteger(pCfg,  "McfgLength", u64McfgLength);
     875
     876
     877            /* And register 2 bridges */
     878            InsertConfigNode(pDevices, "ich9pcibridge", &pDev);
     879            InsertConfigNode(pDev,     "0", &pInst);
     880            InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
     881
     882            InsertConfigNode(pDev,     "1", &pInst);
     883            InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
    874884        }
    875885
     
    13091319                case StorageControllerType_LsiLogic:
    13101320                {
     1321                    // InsertConfigInteger(pCtlInst, "PCIBusNo",             1);
    13111322                    InsertConfigInteger(pCtlInst, "PCIDeviceNo",          20);
    13121323                    Assert(!afPciDeviceNo[20]);
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