Changeset 64420 in vbox for trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
- Timestamp:
- Oct 25, 2016 3:51:03 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r64419 r64420 52 52 * Structures and Typedefs * 53 53 *********************************************************************************************************************************/ 54 typedef DEVPCIBUS ICH9PCIBUS;55 typedef PDEVPCIBUS PICH9PCIBUS;56 typedef DEVPCIROOT ICH9PCIGLOBALS;57 typedef PDEVPCIROOT PICH9PCIGLOBALS;58 59 60 61 62 54 /** 63 55 * PCI configuration space address. … … 70 62 } PciAddress; 71 63 72 #ifndef VBOX_DEVICE_STRUCT_TESTCASE73 74 64 75 65 /********************************************************************************************************************************* 76 66 * Defined Constants And Macros * 77 67 *********************************************************************************************************************************/ 78 79 68 /** @def VBOX_ICH9PCI_SAVED_STATE_VERSION 80 69 * Saved state version of the ICH9 PCI bus device. … … 84 73 #define VBOX_ICH9PCI_SAVED_STATE_VERSION_CURRENT VBOX_ICH9PCI_SAVED_STATE_VERSION_MSI 85 74 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 *********************************************************************************************************************************/ 108 79 /* Prototypes */ 109 static void ich9pciSetIrqInternal(P ICH9PCIGLOBALSpGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev,80 static void ich9pciSetIrqInternal(PDEVPCIROOT pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev, 110 81 int iIrq, int iLevel, uint32_t uTagSrc); 111 82 #ifdef IN_RING3 … … 114 85 static DECLCALLBACK(uint32_t) ich9pciConfigReadDev(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t u32Address, unsigned len); 115 86 static DECLCALLBACK(void) ich9pciConfigWriteDev(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t u32Address, uint32_t val, unsigned len); 116 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(P ICH9PCIBUS pBus, uint8_t iBus);117 static void ich9pciBiosInitDevice(P ICH9PCIGLOBALSpGlobals, uint8_t uBus, uint8_t uDevFn);87 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t iBus); 88 static void ich9pciBiosInitDevice(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn); 118 89 #endif 119 90 120 91 // See 7.2.2. PCI Express Enhanced Configuration Mechanism for details of address 121 92 // mapping, we take n=6 approach 122 DECLINLINE(void) ich9pciPhysToPciAddr(P ICH9PCIGLOBALSpGlobals, RTGCPHYS GCPhysAddr, PciAddress* pPciAddr)93 DECLINLINE(void) ich9pciPhysToPciAddr(PDEVPCIROOT pGlobals, RTGCPHYS GCPhysAddr, PciAddress* pPciAddr) 123 94 { 124 95 NOREF(pGlobals); … … 128 99 } 129 100 130 DECLINLINE(void) ich9pciStateToPciAddr(P ICH9PCIGLOBALSpGlobals, RTGCPHYS addr, PciAddress* pPciAddr)101 DECLINLINE(void) ich9pciStateToPciAddr(PDEVPCIROOT pGlobals, RTGCPHYS addr, PciAddress* pPciAddr) 131 102 { 132 103 pPciAddr->iBus = (pGlobals->uConfigReg >> 16) & 0xff; … … 138 109 { 139 110 LogFlowFunc(("invoked by %p/%d: iIrq=%d iLevel=%d uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, iIrq, iLevel, uTagSrc)); 140 ich9pciSetIrqInternal(PDMINS_2_DATA(pDevIns, P ICH9PCIGLOBALS), pPciDev->uDevFn, pPciDev, iIrq, iLevel, uTagSrc);111 ich9pciSetIrqInternal(PDMINS_2_DATA(pDevIns, PDEVPCIROOT), pPciDev->uDevFn, pPciDev, iIrq, iLevel, uTagSrc); 141 112 } 142 113 … … 150 121 * of our parent passing the device which asserted the interrupt instead of the device of the bridge. 151 122 */ 152 P ICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);123 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 153 124 PPDMPCIDEV pPciDevBus = pPciDev; 154 125 int iIrqPinBridge = iIrq; … … 167 138 168 139 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); 170 141 } 171 142 … … 191 162 if (cb == 4) 192 163 { 193 P ICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);164 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 194 165 195 166 /* … … 227 198 if (cb == 4) 228 199 { 229 P ICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);200 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 230 201 231 202 PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_READ); … … 245 216 * Perform configuration space write. 246 217 */ 247 static int ich9pciDataWriteAddr(P ICH9PCIGLOBALSpGlobals, PciAddress* pAddr,218 static int ich9pciDataWriteAddr(PDEVPCIROOT pGlobals, PciAddress* pAddr, 248 219 uint32_t val, int cb, int rcReschedule) 249 220 { … … 300 271 * similarly named functions. 301 272 */ 302 static int ich9pciDataWrite(P ICH9PCIGLOBALSpGlobals, uint32_t addr, uint32_t val, int len)273 static int ich9pciDataWrite(PDEVPCIROOT pGlobals, uint32_t addr, uint32_t val, int len) 303 274 { 304 275 LogFlow(("ich9pciDataWrite: config=%08x val=%08x len=%d\n", pGlobals->uConfigReg, val, len)); … … 338 309 if (!(Port % cb)) 339 310 { 340 P ICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);311 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 341 312 342 313 PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_WRITE); … … 360 331 * Perform configuration space read. 361 332 */ 362 static int ich9pciDataReadAddr(P ICH9PCIGLOBALSpGlobals, PciAddress* pPciAddr, int cb,333 static int ich9pciDataReadAddr(PDEVPCIROOT pGlobals, PciAddress* pPciAddr, int cb, 363 334 uint32_t *pu32, int rcReschedule) 364 335 { … … 419 390 * similarly named functions. 420 391 */ 421 static int ich9pciDataRead(P ICH9PCIGLOBALSpGlobals, uint32_t addr, int cb, uint32_t *pu32)392 static int ich9pciDataRead(PDEVPCIROOT pGlobals, uint32_t addr, int cb, uint32_t *pu32) 422 393 { 423 394 LogFlow(("ich9pciDataRead: config=%x cb=%d\n", pGlobals->uConfigReg, cb)); … … 457 428 if (!(Port % cb)) 458 429 { 459 P ICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);430 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 460 431 461 432 PCI_LOCK(pDevIns, VINF_IOM_R3_IOPORT_READ); … … 495 466 496 467 /* Add one more level up request on APIC input line */ 497 DECLINLINE(void) ich9pciApicLevelUp(P ICH9PCIGLOBALSpGlobals, int irq_num)468 DECLINLINE(void) ich9pciApicLevelUp(PDEVPCIROOT pGlobals, int irq_num) 498 469 { 499 470 ASMAtomicIncU32(&pGlobals->auPciApicIrqLevels[irq_num]); … … 501 472 502 473 /* Remove one level up request on APIC input line */ 503 DECLINLINE(void) ich9pciApicLevelDown(P ICH9PCIGLOBALSpGlobals, int irq_num)474 DECLINLINE(void) ich9pciApicLevelDown(PDEVPCIROOT pGlobals, int irq_num) 504 475 { 505 476 ASMAtomicDecU32(&pGlobals->auPciApicIrqLevels[irq_num]); 506 477 } 507 478 508 static void ich9pciApicSetIrq(P ICH9PCIBUS pBus, uint8_t uDevFn, PDMPCIDEV *pPciDev, int irq_num1, int iLevel,479 static void ich9pciApicSetIrq(PDEVPCIBUS pBus, uint8_t uDevFn, PDMPCIDEV *pPciDev, int irq_num1, int iLevel, 509 480 uint32_t uTagSrc, int iForcedIrq) 510 481 { … … 515 486 { 516 487 int apic_irq, apic_level; 517 P ICH9PCIGLOBALS pGlobals = PCIROOTBUS_2_PCIGLOBALS(pBus);488 PDEVPCIROOT pGlobals = DEVPCIBUS_2_DEVPCIROOT(pBus); 518 489 int irq_num = ich9pciSlot2ApicIrq(uDevFn >> 3, irq_num1); 519 490 … … 549 520 } 550 521 551 static void ich9pciSetIrqInternal(P ICH9PCIGLOBALSpGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev,522 static void ich9pciSetIrqInternal(PDEVPCIROOT pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev, 552 523 int iIrq, int iLevel, uint32_t uTagSrc) 553 524 { … … 574 545 } 575 546 576 P ICH9PCIBUS pBus = &pGlobals->PciBus;547 PDEVPCIBUS pBus = &pGlobals->PciBus; 577 548 const bool fIsAcpiDevice = PCIDevGetDeviceId(pPciDev) == 0x7113; 578 549 … … 615 586 PDMBOTHCBDECL(int) ich9pciMcfgMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void const *pv, unsigned cb) 616 587 { 617 P ICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);588 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 618 589 uint32_t u32 = 0; 619 590 NOREF(pvUser); … … 667 638 PDMBOTHCBDECL(int) ich9pciMcfgMMIORead (PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb) 668 639 { 669 P ICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);640 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 670 641 uint32_t rv; 671 642 NOREF(pvUser); … … 719 690 720 691 721 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(P ICH9PCIBUS pBus, uint8_t iBus)692 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PDEVPCIBUS pBus, uint8_t iBus) 722 693 { 723 694 /* Search for a fitting bridge. */ … … 774 745 PCIIORegion* pRegion = &pDev->Int.s.aIORegions[iRegion]; 775 746 int rc = VINF_SUCCESS; 776 P ICH9PCIBUS pBus = pDev->Int.s.CTX_SUFF(pBus);747 PDEVPCIBUS pBus = pDev->Int.s.CTX_SUFF(pBus); 777 748 778 749 Assert (pRegion->size != 0); … … 980 951 } 981 952 982 static int ich9pciR3CommonSaveExec(P ICH9PCIBUS pBus, PSSMHANDLE pSSM)953 static int ich9pciR3CommonSaveExec(PDEVPCIBUS pBus, PSSMHANDLE pSSM) 983 954 { 984 955 /* … … 1035 1006 static DECLCALLBACK(int) ich9pciR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) 1036 1007 { 1037 P ICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);1008 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 1038 1009 1039 1010 /* … … 1056 1027 static DECLCALLBACK(int) ich9pcibridgeR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) 1057 1028 { 1058 P ICH9PCIBUS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);1029 PDEVPCIBUS pThis = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 1059 1030 return ich9pciR3CommonSaveExec(pThis, pSSM); 1060 1031 } … … 1063 1034 static DECLCALLBACK(void) ich9pcibridgeConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb) 1064 1035 { 1065 P ICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);1036 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 1066 1037 1067 1038 LogFlowFunc((": pDevIns=%p iBus=%d iDevice=%d u32Address=%u u32Value=%u cb=%d\n", pDevIns, iBus, iDevice, u32Address, u32Value, cb)); … … 1092 1063 static DECLCALLBACK(uint32_t) ich9pcibridgeConfigRead(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, unsigned cb) 1093 1064 { 1094 P ICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);1065 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 1095 1066 uint32_t u32Value; 1096 1067 … … 1303 1274 * @param uPass The pass. 1304 1275 */ 1305 static DECLCALLBACK(int) ich9pciR3CommonLoadExec(P ICH9PCIBUS pBus, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)1276 static DECLCALLBACK(int) ich9pciR3CommonLoadExec(PDEVPCIBUS pBus, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) 1306 1277 { 1307 1278 uint32_t u32; … … 1444 1415 static DECLCALLBACK(int) ich9pciR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) 1445 1416 { 1446 P ICH9PCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);1447 P ICH9PCIBUS pBus = &pThis->PciBus;1417 PDEVPCIROOT pThis = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 1418 PDEVPCIBUS pBus = &pThis->PciBus; 1448 1419 uint32_t u32; 1449 1420 int rc; … … 1478 1449 static DECLCALLBACK(int) ich9pcibridgeR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) 1479 1450 { 1480 P ICH9PCIBUS pThis = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);1451 PDEVPCIBUS pThis = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 1481 1452 if (uVersion > VBOX_ICH9PCI_SAVED_STATE_VERSION_MSI) 1482 1453 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; … … 1489 1460 * Cannot be rescheduled, as already in R3. 1490 1461 */ 1491 static uint32_t ich9pciConfigRead(P ICH9PCIGLOBALSpGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t len)1462 static uint32_t ich9pciConfigRead(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t len) 1492 1463 { 1493 1464 PciAddress aPciAddr; … … 1508 1479 * Cannot be rescheduled, as already in R3. 1509 1480 */ 1510 static void ich9pciConfigWrite(P ICH9PCIGLOBALSpGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t val, uint32_t len)1481 static void ich9pciConfigWrite(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn, uint32_t addr, uint32_t val, uint32_t len) 1511 1482 { 1512 1483 PciAddress aPciAddr; … … 1520 1491 1521 1492 1522 static void ich9pciSetRegionAddress(P ICH9PCIGLOBALSpGlobals, uint8_t uBus, uint8_t uDevFn, int iRegion, uint64_t addr)1493 static void ich9pciSetRegionAddress(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn, int iRegion, uint64_t addr) 1523 1494 { 1524 1495 uint32_t uReg = ich9pciGetRegionReg(iRegion); … … 1539 1510 1540 1511 1541 static void ich9pciBiosInitBridge(P ICH9PCIGLOBALSpGlobals, uint8_t uBus, uint8_t uDevFn)1512 static void ich9pciBiosInitBridge(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn) 1542 1513 { 1543 1514 Log(("BIOS init bridge: %02x::%02x.%d\n", uBus, uDevFn >> 3, uDevFn & 7)); … … 1605 1576 } 1606 1577 1607 static void ich9pciBiosInitDevice(P ICH9PCIGLOBALSpGlobals, uint8_t uBus, uint8_t uDevFn)1578 static void ich9pciBiosInitDevice(PDEVPCIROOT pGlobals, uint8_t uBus, uint8_t uDevFn) 1608 1579 { 1609 1580 uint16_t uDevClass, uVendor, uDevice; … … 1784 1755 { 1785 1756 /* Find bus this device attached to. */ 1786 P ICH9PCIBUS pBus = &pGlobals->PciBus;1757 PDEVPCIBUS pBus = &pGlobals->PciBus; 1787 1758 while (1) 1788 1759 { … … 1798 1769 break; 1799 1770 } 1800 pBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), P ICH9PCIBUS);1771 pBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS); 1801 1772 } 1802 1773 … … 1828 1799 * @param uBusSecondary The secondary bus number, i.e. the bus number behind the bridge. 1829 1800 */ 1830 static void ich9pciInitBridgeTopology(P ICH9PCIGLOBALS pGlobals, PICH9PCIBUS pBus, unsigned uBusPrimary,1801 static void ich9pciInitBridgeTopology(PDEVPCIROOT pGlobals, PDEVPCIBUS pBus, unsigned uBusPrimary, 1831 1802 unsigned uBusSecondary) 1832 1803 { … … 1845 1816 AssertMsg(pBridge && pciDevIsPci2PciBridge(pBridge), 1846 1817 ("Device is not a PCI bridge but on the list of PCI bridges\n")); 1847 P ICH9PCIBUS pChildBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PICH9PCIBUS);1818 PDEVPCIBUS pChildBus = PDMINS_2_DATA(pBridge->Int.s.CTX_SUFF(pDevIns), PDEVPCIBUS); 1848 1819 pGlobals->uPciBiosBus++; 1849 1820 ich9pciInitBridgeTopology(pGlobals, pChildBus, uBusSecondary, pGlobals->uPciBiosBus); … … 1861 1832 static DECLCALLBACK(int) ich9pciFakePCIBIOS(PPDMDEVINS pDevIns) 1862 1833 { 1863 P ICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);1834 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 1864 1835 PVM pVM = PDMDevHlpGetVM(pDevIns); 1865 1836 uint32_t const cbBelow4GB = MMR3PhysGetRamSizeBelow4GB(pVM); … … 1885 1856 * Assign bridge topology, for further routing to work. 1886 1857 */ 1887 P ICH9PCIBUS pBus = &pGlobals->PciBus;1858 PDEVPCIBUS pBus = &pGlobals->PciBus; 1888 1859 ich9pciInitBridgeTopology(pGlobals, pBus, 0, 0); 1889 1860 … … 2166 2137 } 2167 2138 2168 static void ich9pciBusInfo(P ICH9PCIBUS pBus, PCDBGFINFOHLP pHlp, int iIndent, bool fRegisters)2139 static void ich9pciBusInfo(PDEVPCIBUS pBus, PCDBGFINFOHLP pHlp, int iIndent, bool fRegisters) 2169 2140 { 2170 2141 for (uint32_t iDev = 0; iDev < RT_ELEMENTS(pBus->apDevices); iDev++) … … 2284 2255 for (uint32_t iBridge = 0; iBridge < pBus->cBridges; iBridge++) 2285 2256 { 2286 P ICH9PCIBUS 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); 2287 2258 ich9pciBusInfo(pBusSub, pHlp, iIndent + 1, fRegisters); 2288 2259 } … … 2299 2270 static DECLCALLBACK(void) ich9pciInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) 2300 2271 { 2301 P ICH9PCIBUS pBus = DEVINS_2_PCIBUS(pDevIns);2272 PDEVPCIBUS pBus = DEVINS_2_DEVPCIBUS(pDevIns); 2302 2273 2303 2274 if (pszArgs == NULL || !strcmp(pszArgs, "basic")) … … 2359 2330 * Init data. 2360 2331 */ 2361 P ICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);2362 P ICH9PCIBUS pBus = &pGlobals->PciBus;2332 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 2333 PDEVPCIBUS pBus = &pGlobals->PciBus; 2363 2334 /* Zero out everything */ 2364 2335 memset(pGlobals, 0, sizeof(*pGlobals)); … … 2563 2534 static DECLCALLBACK(void) ich9pciReset(PPDMDEVINS pDevIns) 2564 2535 { 2565 P ICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);2566 P ICH9PCIBUS pBus = &pGlobals->PciBus;2536 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 2537 PDEVPCIBUS pBus = &pGlobals->PciBus; 2567 2538 2568 2539 /* PCI-specific reset for each device. */ … … 2597 2568 static DECLCALLBACK(void) ich9pciRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta) 2598 2569 { 2599 P ICH9PCIGLOBALS pGlobals = PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS);2600 P ICH9PCIBUS pBus = &pGlobals->PciBus;2570 PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT); 2571 PDEVPCIBUS pBus = &pGlobals->PciBus; 2601 2572 pGlobals->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 2602 2573 … … 2643 2614 * Init data and register the PCI bus. 2644 2615 */ 2645 P ICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);2616 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 2646 2617 pBus->fTypePiix3 = false; 2647 2618 pBus->fTypeIch9 = true; … … 2741 2712 static void ich9pcibridgeReset(PPDMDEVINS pDevIns) 2742 2713 { 2743 P ICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);2714 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 2744 2715 2745 2716 /* Reset config space to default values. */ … … 2762 2733 static DECLCALLBACK(void) ich9pcibridgeRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta) 2763 2734 { 2764 P ICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);2735 PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS); 2765 2736 pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 2766 2737 … … 2792 2763 1, 2793 2764 /* cbInstance */ 2794 sizeof( ICH9PCIGLOBALS),2765 sizeof(DEVPCIROOT), 2795 2766 /* pfnConstruct */ 2796 2767 ich9pciConstruct, … … 2882 2853 2883 2854 #endif /* IN_RING3 */ 2884 #endif /* !VBOX_DEVICE_STRUCT_TESTCASE */ 2855
Note:
See TracChangeset
for help on using the changeset viewer.