VirtualBox

Changeset 64707 in vbox for trunk


Ignore:
Timestamp:
Nov 18, 2016 10:11:14 AM (8 years ago)
Author:
vboxsync
Message:

DevPciIch9: add bus topology information to "info pci", to disambiguate the output. Additionally some variable size/variable prefix cleanup to improve consistency.

File:
1 edited

Legend:

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

    r64702 r64707  
    8383#ifdef IN_RING3
    8484static void ich9pcibridgeReset(PPDMDEVINS pDevIns);
    85 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t iBus);
     85DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t uBus);
    8686static void ich9pciBiosInitDevice(PDEVPCIROOT pPciRoot, uint8_t uBus, uint8_t uDevFn);
    8787#endif
     
    687687
    688688
    689 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t iBus)
     689DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t uBus)
    690690{
    691691    /* Search for a fitting bridge. */
     
    701701        uint32_t uSecondary   = PDMPciDevGetByte(pBridge, VBOX_PCI_SECONDARY_BUS);
    702702        uint32_t uSubordinate = PDMPciDevGetByte(pBridge, VBOX_PCI_SUBORDINATE_BUS);
    703         Log3(("ich9pciFindBridge on bus %p, bridge %d: %d in %d..%d\n", pBus, iBridge, iBus, uSecondary, uSubordinate));
    704         if (iBus >= uSecondary && iBus <= uSubordinate)
     703        Log3(("ich9pciFindBridge on bus %p, bridge %d: %d in %d..%d\n", pBus, iBridge, uBus, uSecondary, uSubordinate));
     704        if (uBus >= uSecondary && uBus <= uSubordinate)
    705705            return pBridge;
    706706    }
     
    922922
    923923
    924 static DECLCALLBACK(void) ich9pcibridgeConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb)
     924static DECLCALLBACK(void) ich9pcibridgeConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t uBus, uint8_t uDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb)
    925925{
    926926    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    927927
    928     LogFlowFunc((": pDevIns=%p iBus=%d iDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, iBus, iDevice, u32Address, u32Value, cb));
     928    LogFlowFunc((": pDevIns=%p uBus=%d uDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, u32Value, cb));
    929929
    930930    /* If the current bus is not the target bus search for the bus which contains the device. */
    931     if (iBus != PDMPciDevGetByte(&pBus->PciDev, VBOX_PCI_SECONDARY_BUS))
    932     {
    933         PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(pBus, iBus);
     931    if (uBus != PDMPciDevGetByte(&pBus->PciDev, VBOX_PCI_SECONDARY_BUS))
     932    {
     933        PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(pBus, uBus);
    934934        if (pBridgeDevice)
    935935        {
    936936            AssertPtr(pBridgeDevice->Int.s.pfnBridgeConfigWrite);
    937             pBridgeDevice->Int.s.pfnBridgeConfigWrite(pBridgeDevice->Int.s.CTX_SUFF(pDevIns), iBus, iDevice,
     937            pBridgeDevice->Int.s.pfnBridgeConfigWrite(pBridgeDevice->Int.s.CTX_SUFF(pDevIns), uBus, uDevice,
    938938                                                      u32Address, u32Value, cb);
    939939        }
     
    942942    {
    943943        /* This is the target bus, pass the write to the device. */
    944         PPDMPCIDEV pPciDev = pBus->apDevices[iDevice];
     944        PPDMPCIDEV pPciDev = pBus->apDevices[uDevice];
    945945        if (pPciDev)
    946946        {
     
    951951}
    952952
    953 static DECLCALLBACK(uint32_t) ich9pcibridgeConfigRead(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, unsigned cb)
     953static DECLCALLBACK(uint32_t) ich9pcibridgeConfigRead(PPDMDEVINSR3 pDevIns, uint8_t uBus, uint8_t uDevice, uint32_t u32Address, unsigned cb)
    954954{
    955955    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    956956    uint32_t u32Value;
    957957
    958     LogFlowFunc((": pDevIns=%p iBus=%d iDevice=%d u32Address=%u cb=%d\n", pDevIns, iBus, iDevice, u32Address, cb));
     958    LogFlowFunc((": pDevIns=%p uBus=%d uDevice=%d u32Address=%u cb=%d\n", pDevIns, uBus, uDevice, u32Address, cb));
    959959
    960960    /* If the current bus is not the target bus search for the bus which contains the device. */
    961     if (iBus != PDMPciDevGetByte(&pBus->PciDev, VBOX_PCI_SECONDARY_BUS))
    962     {
    963         PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(pBus, iBus);
     961    if (uBus != PDMPciDevGetByte(&pBus->PciDev, VBOX_PCI_SECONDARY_BUS))
     962    {
     963        PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(pBus, uBus);
    964964        if (pBridgeDevice)
    965965        {
    966966            AssertPtr( pBridgeDevice->Int.s.pfnBridgeConfigRead);
    967             u32Value = pBridgeDevice->Int.s.pfnBridgeConfigRead(pBridgeDevice->Int.s.CTX_SUFF(pDevIns), iBus, iDevice,
     967            u32Value = pBridgeDevice->Int.s.pfnBridgeConfigRead(pBridgeDevice->Int.s.CTX_SUFF(pDevIns), uBus, uDevice,
    968968                                                                u32Address, cb);
    969969        }
     
    974974    {
    975975        /* This is the target bus, pass the read to the device. */
    976         PPDMPCIDEV pPciDev = pBus->apDevices[iDevice];
     976        PPDMPCIDEV pPciDev = pBus->apDevices[uDevice];
    977977        if (pPciDev)
    978978        {
     
    17011701 * @param   uBusPrimary      The primary bus number the bus is connected to.
    17021702 */
    1703 static uint8_t ich9pciBiosInitBridgeTopology(PDEVPCIROOT pPciRoot, PDEVPCIBUS pBus, uint32_t *pbmUsed, unsigned uBusPrimary)
     1703static uint8_t ich9pciBiosInitBridgeTopology(PDEVPCIROOT pPciRoot, PDEVPCIBUS pBus, uint32_t *pbmUsed, uint8_t uBusPrimary)
    17041704{
    17051705    PPDMPCIDEV pBridgeDev = &pBus->PciDev;
     
    23572357        {
    23582358            PDEVPCIBUS pBusSub = PDMINS_2_DATA(pBus->papBridgesR3[iBridge]->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS);
     2359            devpciR3InfoIndent(pHlp, iIndentLvl);
     2360            pHlp->pfnPrintf(pHlp, "bridge topology: primary=%d secondary=%d subordinate=%d\n",
     2361                            PDMPciDevGetByte(&pBusSub->PciDev, VBOX_PCI_PRIMARY_BUS),
     2362                            PDMPciDevGetByte(&pBusSub->PciDev, VBOX_PCI_SECONDARY_BUS),
     2363                            PDMPciDevGetByte(&pBusSub->PciDev, VBOX_PCI_SUBORDINATE_BUS));
    23592364            devpciR3InfoPciBus(pBusSub, pHlp, iIndentLvl + 1, fRegisters);
    23602365        }
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