VirtualBox

Ignore:
Timestamp:
Oct 25, 2016 3:51:03 PM (8 years ago)
Author:
vboxsync
Message:

DevPci: Post ICH9PCIGLOBALS and PCIGLOBALS cleanups.

File:
1 edited

Legend:

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

    r64419 r64420  
    5252*   Structures and Typedefs                                                                                                      *
    5353*********************************************************************************************************************************/
    54 typedef DEVPCIBUS     ICH9PCIBUS;
    55 typedef PDEVPCIBUS    PICH9PCIBUS;
    56 typedef DEVPCIROOT    ICH9PCIGLOBALS;
    57 typedef PDEVPCIROOT   PICH9PCIGLOBALS;
    58 
    59 
    60 
    61 
    6254/**
    6355 * PCI configuration space address.
     
    7062} PciAddress;
    7163
    72 #ifndef VBOX_DEVICE_STRUCT_TESTCASE
    73 
    7464
    7565/*********************************************************************************************************************************
    7666*   Defined Constants And Macros                                                                                                 *
    7767*********************************************************************************************************************************/
    78 
    7968/** @def VBOX_ICH9PCI_SAVED_STATE_VERSION
    8069 * Saved state version of the ICH9 PCI bus device.
     
    8473#define VBOX_ICH9PCI_SAVED_STATE_VERSION_CURRENT VBOX_ICH9PCI_SAVED_STATE_VERSION_MSI
    8574
    86 /** Converts a bus instance pointer to a device instance pointer. */
    87 #define PCIBUS_2_DEVINS(pPciBus)        ((pPciBus)->CTX_SUFF(pDevIns))
    88 /** Converts a device instance pointer to a ICH9PCIGLOBALS pointer. */
    89 #define DEVINS_2_PCIGLOBALS(pDevIns)    ((PICH9PCIGLOBALS)(PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS)))
    90 /** Converts a device instance pointer to a PCIBUS pointer. */
    91 #define DEVINS_2_PCIBUS(pDevIns)        ((PICH9PCIBUS)(&PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS)->PciBus))
    92 /** Converts a pointer to a PCI root bus instance to a PCIGLOBALS pointer. */
    93 #define PCIROOTBUS_2_PCIGLOBALS(pPciBus)    ( (PICH9PCIGLOBALS)((uintptr_t)(pPciBus) - RT_OFFSETOF(ICH9PCIGLOBALS, PciBus)) )
    94 
    95 /** @def PCI_LOCK
    96  * Acquires the PDM lock. This is a NOP if locking is disabled. */
    97 /** @def PCI_UNLOCK
    98  * Releases the PDM lock. This is a NOP if locking is disabled. */
    99 #define PCI_LOCK(pDevIns, rc) \
    100     do { \
    101         int rc2 = DEVINS_2_PCIBUS(pDevIns)->CTX_SUFF(pPciHlp)->pfnLock((pDevIns), rc); \
    102         if (rc2 != VINF_SUCCESS) \
    103             return rc2; \
    104     } while (0)
    105 #define PCI_UNLOCK(pDevIns) \
    106     DEVINS_2_PCIBUS(pDevIns)->CTX_SUFF(pPciHlp)->pfnUnlock(pDevIns)
    107 
     75
     76/*********************************************************************************************************************************
     77*   Internal Functions                                                                                                           *
     78*********************************************************************************************************************************/
    10879/* Prototypes */
    109 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev,
     80static void ich9pciSetIrqInternal(PDEVPCIROOT pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev,
    11081                                  int iIrq, int iLevel, uint32_t uTagSrc);
    11182#ifdef IN_RING3
     
    11485static DECLCALLBACK(uint32_t) ich9pciConfigReadDev(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t u32Address, unsigned len);
    11586static DECLCALLBACK(void)     ich9pciConfigWriteDev(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t u32Address, uint32_t val, unsigned len);
    116 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PICH9PCIBUS pBus, uint8_t iBus);
    117 static void ich9pciBiosInitDevice(PICH9PCIGLOBALS pGlobals, uint8_t uBus, uint8_t uDevFn);
     87DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t iBus);
     88static void ich9pciBiosInitDevice(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn);
    11889#endif
    11990
    12091// See 7.2.2. PCI Express Enhanced Configuration Mechanism for details of address
    12192// mapping, we take n=6 approach
    122 DECLINLINE(void) ich9pciPhysToPciAddr(PICH9PCIGLOBALS pGlobals, RTGCPHYS GCPhysAddr, PciAddress* pPciAddr)
     93DECLINLINE(void) ich9pciPhysToPciAddr(PDEVPCIROOT pGlobals, RTGCPHYS GCPhysAddr, PciAddress* pPciAddr)
    12394{
    12495    NOREF(pGlobals);
     
    12899}
    129100
    130 DECLINLINE(void) ich9pciStateToPciAddr(PICH9PCIGLOBALS pGlobals, RTGCPHYS addr, PciAddress* pPciAddr)
     101DECLINLINE(void) ich9pciStateToPciAddr(PDEVPCIROOT pGlobals, RTGCPHYS addr, PciAddress* pPciAddr)
    131102{
    132103    pPciAddr->iBus         = (pGlobals->uConfigReg >> 16) & 0xff;
     
    138109{
    139110    LogFlowFunc(("invoked by %p/%d: iIrq=%d iLevel=%d uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, iIrq, iLevel, uTagSrc));
    140     ich9pciSetIrqInternal(PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS), pPciDev->uDevFn, pPciDev, iIrq, iLevel, uTagSrc);
     111    ich9pciSetIrqInternal(PDMINS_2_DATA(pDevIns, PDEVPCIROOT), pPciDev->uDevFn, pPciDev, iIrq, iLevel, uTagSrc);
    141112}
    142113
     
    150121     * of our parent passing the device which asserted the interrupt instead of the device of the bridge.
    151122     */
    152     PICH9PCIBUS    pBus          = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     123    PDEVPCIBUS    pBus          = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    153124    PPDMPCIDEV     pPciDevBus    = pPciDev;
    154125    int            iIrqPinBridge = iIrq;
     
    167138
    168139    AssertMsgReturnVoid(pBus->iBus == 0, ("This is not the host pci bus iBus=%d\n", pBus->iBus));
    169     ich9pciSetIrqInternal(PCIROOTBUS_2_PCIGLOBALS(pBus), uDevFnBridge, pPciDev, iIrqPinBridge, iLevel, uTagSrc);
     140    ich9pciSetIrqInternal(DEVPCIBUS_2_DEVPCIROOT(pBus), uDevFnBridge, pPciDev, iIrqPinBridge, iLevel, uTagSrc);
    170141}
    171142
     
    191162    if (cb == 4)
    192163    {
    193         PICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     164        PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    194165
    195166        /*
     
    227198    if (cb == 4)
    228199    {
    229         PICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     200        PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    230201
    231202        PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_READ);
     
    245216 * Perform configuration space write.
    246217 */
    247 static int ich9pciDataWriteAddr(PICH9PCIGLOBALS pGlobals, PciAddress* pAddr,
     218static int ich9pciDataWriteAddr(PDEVPCIROOT pGlobals, PciAddress* pAddr,
    248219                                uint32_t val, int cb, int rcReschedule)
    249220{
     
    300271 * similarly named functions.
    301272 */
    302 static int ich9pciDataWrite(PICH9PCIGLOBALS pGlobals, uint32_t addr, uint32_t val, int len)
     273static int ich9pciDataWrite(PDEVPCIROOT pGlobals, uint32_t addr, uint32_t val, int len)
    303274{
    304275    LogFlow(("ich9pciDataWrite: config=%08x val=%08x len=%d\n", pGlobals->uConfigReg, val, len));
     
    338309    if (!(Port % cb))
    339310    {
    340         PICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     311        PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    341312
    342313        PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_WRITE);
     
    360331 * Perform configuration space read.
    361332 */
    362 static int ich9pciDataReadAddr(PICH9PCIGLOBALS pGlobals, PciAddress* pPciAddr, int cb,
     333static int ich9pciDataReadAddr(PDEVPCIROOT pGlobals, PciAddress* pPciAddr, int cb,
    363334                               uint32_t *pu32, int rcReschedule)
    364335{
     
    419390 * similarly named functions.
    420391 */
    421 static int ich9pciDataRead(PICH9PCIGLOBALS pGlobals, uint32_t addr, int cb, uint32_t *pu32)
     392static int ich9pciDataRead(PDEVPCIROOT pGlobals, uint32_t addr, int cb, uint32_t *pu32)
    422393{
    423394    LogFlow(("ich9pciDataRead: config=%x cb=%d\n",  pGlobals->uConfigReg, cb));
     
    457428    if (!(Port % cb))
    458429    {
    459         PICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     430        PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    460431
    461432        PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_READ);
     
    495466
    496467/* Add one more level up request on APIC input line */
    497 DECLINLINE(void) ich9pciApicLevelUp(PICH9PCIGLOBALS pGlobals, int irq_num)
     468DECLINLINE(void) ich9pciApicLevelUp(PDEVPCIROOT pGlobals, int irq_num)
    498469{
    499470    ASMAtomicIncU32(&pGlobals->auPciApicIrqLevels[irq_num]);
     
    501472
    502473/* Remove one level up request on APIC input line */
    503 DECLINLINE(void) ich9pciApicLevelDown(PICH9PCIGLOBALS pGlobals, int irq_num)
     474DECLINLINE(void) ich9pciApicLevelDown(PDEVPCIROOT pGlobals, int irq_num)
    504475{
    505476    ASMAtomicDecU32(&pGlobals->auPciApicIrqLevels[irq_num]);
    506477}
    507478
    508 static void ich9pciApicSetIrq(PICH9PCIBUS pBus, uint8_t uDevFn, PDMPCIDEV *pPciDev, int irq_num1, int iLevel,
     479static void ich9pciApicSetIrq(PDEVPCIBUS pBus, uint8_t uDevFn, PDMPCIDEV *pPciDev, int irq_num1, int iLevel,
    509480                              uint32_t uTagSrc, int iForcedIrq)
    510481{
     
    515486    {
    516487        int apic_irq, apic_level;
    517         PICH9PCIGLOBALS pGlobals = PCIROOTBUS_2_PCIGLOBALS(pBus);
     488        PDEVPCIROOT pGlobals = DEVPCIBUS_2_DEVPCIROOT(pBus);
    518489        int irq_num = ich9pciSlot2ApicIrq(uDevFn >> 3, irq_num1);
    519490
     
    549520}
    550521
    551 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev,
     522static void ich9pciSetIrqInternal(PDEVPCIROOT pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev,
    552523                                  int iIrq, int iLevel, uint32_t uTagSrc)
    553524{
     
    574545    }
    575546
    576     PICH9PCIBUS     pBus      =     &pGlobals->PciBus;
     547    PDEVPCIBUS     pBus      =     &pGlobals->PciBus;
    577548    const bool  fIsAcpiDevice = PCIDevGetDeviceId(pPciDev) == 0x7113;
    578549
     
    615586PDMBOTHCBDECL(int) ich9pciMcfgMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void const *pv, unsigned cb)
    616587{
    617     PICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     588    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    618589    uint32_t u32 = 0;
    619590    NOREF(pvUser);
     
    667638PDMBOTHCBDECL(int) ich9pciMcfgMMIORead (PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb)
    668639{
    669     PICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     640    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    670641    uint32_t    rv;
    671642    NOREF(pvUser);
     
    719690
    720691
    721 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PICH9PCIBUS pBus, uint8_t iBus)
     692DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t iBus)
    722693{
    723694    /* Search for a fitting bridge. */
     
    774745    PCIIORegion* pRegion = &pDev->Int.s.aIORegions[iRegion];
    775746    int rc = VINF_SUCCESS;
    776     PICH9PCIBUS pBus = pDev->Int.s.CTX_SUFF(pBus);
     747    PDEVPCIBUS pBus = pDev->Int.s.CTX_SUFF(pBus);
    777748
    778749    Assert (pRegion->size != 0);
     
    980951}
    981952
    982 static int ich9pciR3CommonSaveExec(PICH9PCIBUS pBus, PSSMHANDLE pSSM)
     953static int ich9pciR3CommonSaveExec(PDEVPCIBUS pBus, PSSMHANDLE pSSM)
    983954{
    984955    /*
     
    10351006static DECLCALLBACK(int) ich9pciR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
    10361007{
    1037     PICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     1008    PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    10381009
    10391010    /*
     
    10561027static DECLCALLBACK(int) ich9pcibridgeR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
    10571028{
    1058     PICH9PCIBUS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     1029    PDEVPCIBUS pThis = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    10591030    return ich9pciR3CommonSaveExec(pThis, pSSM);
    10601031}
     
    10631034static DECLCALLBACK(void) ich9pcibridgeConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb)
    10641035{
    1065     PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     1036    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    10661037
    10671038    LogFlowFunc((": pDevIns=%p iBus=%d iDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, iBus, iDevice, u32Address, u32Value, cb));
     
    10921063static DECLCALLBACK(uint32_t) ich9pcibridgeConfigRead(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, unsigned cb)
    10931064{
    1094     PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     1065    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    10951066    uint32_t u32Value;
    10961067
     
    13031274 * @param   uPass               The pass.
    13041275 */
    1305 static DECLCALLBACK(int) ich9pciR3CommonLoadExec(PICH9PCIBUS pBus, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
     1276static DECLCALLBACK(int) ich9pciR3CommonLoadExec(PDEVPCIBUS pBus, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    13061277{
    13071278    uint32_t    u32;
     
    14441415static DECLCALLBACK(int) ich9pciR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    14451416{
    1446     PICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
    1447     PICH9PCIBUS     pBus  = &pThis->PciBus;
     1417    PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     1418    PDEVPCIBUS     pBus  = &pThis->PciBus;
    14481419    uint32_t        u32;
    14491420    int             rc;
     
    14781449static DECLCALLBACK(int) ich9pcibridgeR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    14791450{
    1480     PICH9PCIBUS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     1451    PDEVPCIBUS pThis = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    14811452    if (uVersion > VBOX_ICH9PCI_SAVED_STATE_VERSION_MSI)
    14821453        return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION;
     
    14891460 * Cannot be rescheduled, as already in R3.
    14901461 */
    1491 static uint32_t ich9pciConfigRead(PICH9PCIGLOBALS pGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t len)
     1462static uint32_t ich9pciConfigRead(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t len)
    14921463{
    14931464    PciAddress aPciAddr;
     
    15081479 * Cannot be rescheduled, as already in R3.
    15091480 */
    1510 static void ich9pciConfigWrite(PICH9PCIGLOBALS pGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t val, uint32_t len)
     1481static void ich9pciConfigWrite(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t val, uint32_t len)
    15111482{
    15121483    PciAddress aPciAddr;
     
    15201491
    15211492
    1522 static void ich9pciSetRegionAddress(PICH9PCIGLOBALS pGlobals, uint8_t uBus, uint8_t uDevFn, int iRegion, uint64_t addr)
     1493static void ich9pciSetRegionAddress(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn, int iRegion, uint64_t addr)
    15231494{
    15241495    uint32_t uReg = ich9pciGetRegionReg(iRegion);
     
    15391510
    15401511
    1541 static void ich9pciBiosInitBridge(PICH9PCIGLOBALS pGlobals, uint8_t uBus, uint8_t uDevFn)
     1512static void ich9pciBiosInitBridge(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn)
    15421513{
    15431514    Log(("BIOS init bridge: %02x::%02x.%d\n", uBus, uDevFn >> 3, uDevFn & 7));
     
    16051576}
    16061577
    1607 static void ich9pciBiosInitDevice(PICH9PCIGLOBALS pGlobals, uint8_t uBus, uint8_t uDevFn)
     1578static void ich9pciBiosInitDevice(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn)
    16081579{
    16091580    uint16_t uDevClass, uVendor, uDevice;
     
    17841755        {
    17851756            /* Find bus this device attached to. */
    1786             PICH9PCIBUS pBus = &pGlobals->PciBus;
     1757            PDEVPCIBUS pBus = &pGlobals->PciBus;
    17871758            while (1)
    17881759            {
     
    17981769                    break;
    17991770                }
    1800                 pBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PICH9PCIBUS);
     1771                pBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS);
    18011772            }
    18021773
     
    18281799 * @param   uBusSecondary    The secondary bus number, i.e. the bus number behind the bridge.
    18291800 */
    1830 static void ich9pciInitBridgeTopology(PICH9PCIGLOBALS pGlobals, PICH9PCIBUS pBus, unsigned uBusPrimary,
     1801static void ich9pciInitBridgeTopology(PDEVPCIROOT pGlobals, PDEVPCIBUS pBus, unsigned uBusPrimary,
    18311802                                      unsigned uBusSecondary)
    18321803{
     
    18451816        AssertMsg(pBridge && pciDevIsPci2PciBridge(pBridge),
    18461817                  ("Device is not a PCI bridge but on the list of PCI bridges\n"));
    1847         PICH9PCIBUS pChildBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PICH9PCIBUS);
     1818        PDEVPCIBUS pChildBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS);
    18481819        pGlobals->uPciBiosBus++;
    18491820        ich9pciInitBridgeTopology(pGlobals, pChildBus, uBusSecondary, pGlobals->uPciBiosBus);
     
    18611832static DECLCALLBACK(int) ich9pciFakePCIBIOS(PPDMDEVINS pDevIns)
    18621833{
    1863     PICH9PCIGLOBALS pGlobals   = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
     1834    PDEVPCIROOT pGlobals   = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
    18641835    PVM             pVM        = PDMDevHlpGetVM(pDevIns);
    18651836    uint32_t const  cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM);
     
    18851856     * Assign bridge topology, for further routing to work.
    18861857     */
    1887     PICH9PCIBUS pBus = &pGlobals->PciBus;
     1858    PDEVPCIBUS pBus = &pGlobals->PciBus;
    18881859    ich9pciInitBridgeTopology(pGlobals, pBus, 0, 0);
    18891860
     
    21662137}
    21672138
    2168 static void ich9pciBusInfo(PICH9PCIBUS pBus, PCDBGFINFOHLP pHlp, int iIndent, bool fRegisters)
     2139static void ich9pciBusInfo(PDEVPCIBUS pBus, PCDBGFINFOHLP pHlp, int iIndent, bool fRegisters)
    21692140{
    21702141    for (uint32_t iDev = 0; iDev < RT_ELEMENTS(pBus->apDevices); iDev++)
     
    22842255        for (uint32_t iBridge = 0; iBridge < pBus->cBridges; iBridge++)
    22852256        {
    2286             PICH9PCIBUS pBusSub = PDMINS_2_DATA(pBus->papBridgesR3[iBridge]->Int.s.CTX_SUFF(pDevIns), PICH9PCIBUS);
     2257            PDEVPCIBUS pBusSub = PDMINS_2_DATA(pBus->papBridgesR3[iBridge]->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS);
    22872258            ich9pciBusInfo(pBusSub, pHlp, iIndent + 1, fRegisters);
    22882259        }
     
    22992270static DECLCALLBACK(void) ich9pciInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
    23002271{
    2301     PICH9PCIBUS pBus = DEVINS_2_PCIBUS(pDevIns);
     2272    PDEVPCIBUS pBus = DEVINS_2_DEVPCIBUS(pDevIns);
    23022273
    23032274    if (pszArgs == NULL || !strcmp(pszArgs, "basic"))
     
    23592330     * Init data.
    23602331     */
    2361     PICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
    2362     PICH9PCIBUS     pBus     = &pGlobals->PciBus;
     2332    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     2333    PDEVPCIBUS     pBus     = &pGlobals->PciBus;
    23632334    /* Zero out everything */
    23642335    memset(pGlobals, 0, sizeof(*pGlobals));
     
    25632534static DECLCALLBACK(void) ich9pciReset(PPDMDEVINS pDevIns)
    25642535{
    2565     PICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
    2566     PICH9PCIBUS     pBus     = &pGlobals->PciBus;
     2536    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     2537    PDEVPCIBUS     pBus     = &pGlobals->PciBus;
    25672538
    25682539    /* PCI-specific reset for each device. */
     
    25972568static DECLCALLBACK(void) ich9pciRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
    25982569{
    2599     PICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);
    2600     PICH9PCIBUS     pBus     = &pGlobals->PciBus;
     2570    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
     2571    PDEVPCIBUS     pBus     = &pGlobals->PciBus;
    26012572    pGlobals->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    26022573
     
    26432614     * Init data and register the PCI bus.
    26442615     */
    2645     PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     2616    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    26462617    pBus->fTypePiix3  = false;
    26472618    pBus->fTypeIch9   = true;
     
    27412712static void ich9pcibridgeReset(PPDMDEVINS pDevIns)
    27422713{
    2743     PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     2714    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    27442715
    27452716    /* Reset config space to default values. */
     
    27622733static DECLCALLBACK(void) ich9pcibridgeRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
    27632734{
    2764     PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
     2735    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
    27652736    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    27662737
     
    27922763    1,
    27932764    /* cbInstance */
    2794     sizeof(ICH9PCIGLOBALS),
     2765    sizeof(DEVPCIROOT),
    27952766    /* pfnConstruct */
    27962767    ich9pciConstruct,
     
    28822853
    28832854#endif /* IN_RING3 */
    2884 #endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
     2855
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