Changeset 64387 in vbox for trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
- Timestamp:
- Oct 24, 2016 2:06:02 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r64373 r64387 57 57 58 58 /** Array of PCI devices. We assume 32 slots, each with 8 functions. */ 59 R3PTRTYPE(PP CIDEVICE) apDevices[256];59 R3PTRTYPE(PPDMPCIDEV) apDevices[256]; 60 60 /** Array of bridges attached to the bus. */ 61 R3PTRTYPE(PP CIDEVICE*) papBridgesR3;61 R3PTRTYPE(PPDMPCIDEV *) papBridgesR3; 62 62 63 63 /** R3 pointer to the device instance. */ … … 77 77 78 78 /** The PCI device for the PCI bridge. */ 79 P CIDEVICEaPciDev;79 PDMPCIDEV aPciDev; 80 80 81 81 /** Start device number - always zero (only for DevPCI source compat). */ … … 177 177 178 178 /* Prototypes */ 179 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PP CIDEVICEpPciDev,179 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev, 180 180 int iIrq, int iLevel, uint32_t uTagSrc); 181 181 #ifdef IN_RING3 182 182 static void ich9pcibridgeReset(PPDMDEVINS pDevIns); 183 static void ich9pciUpdateMappings(P CIDevice*pDev);183 static void ich9pciUpdateMappings(PDMPCIDEV *pDev); 184 184 static DECLCALLBACK(uint32_t) ich9pciConfigReadDev(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t u32Address, unsigned len); 185 185 static DECLCALLBACK(void) ich9pciConfigWriteDev(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t u32Address, uint32_t val, unsigned len); 186 DECLINLINE(PP CIDEVICE) ich9pciFindBridge(PICH9PCIBUS pBus, uint8_t iBus);186 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PICH9PCIBUS pBus, uint8_t iBus); 187 187 static void ich9pciBiosInitDevice(PICH9PCIGLOBALS pGlobals, uint8_t uBus, uint8_t uDevFn); 188 188 #endif … … 205 205 } 206 206 207 PDMBOTHCBDECL(void) ich9pciSetIrq(PPDMDEVINS pDevIns, PP CIDEVICEpPciDev, int iIrq, int iLevel, uint32_t uTagSrc)207 PDMBOTHCBDECL(void) ich9pciSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc) 208 208 { 209 209 LogFlowFunc(("invoked by %p/%d: iIrq=%d iLevel=%d uTagSrc=%#x\n", pDevIns, pDevIns->iInstance, iIrq, iLevel, uTagSrc)); … … 211 211 } 212 212 213 PDMBOTHCBDECL(void) ich9pcibridgeSetIrq(PPDMDEVINS pDevIns, PP CIDEVICEpPciDev, int iIrq, int iLevel, uint32_t uTagSrc)213 PDMBOTHCBDECL(void) ich9pcibridgeSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc) 214 214 { 215 215 /* … … 221 221 */ 222 222 PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS); 223 PP CIDEVICEpPciDevBus = pPciDev;223 PPDMPCIDEV pPciDevBus = pPciDev; 224 224 int iIrqPinBridge = iIrq; 225 225 uint8_t uDevFnBridge = 0; … … 330 330 { 331 331 #ifdef IN_RING3 /** @todo do lookup in R0/RC too! */ 332 PP CIDEVICEpBridgeDevice = ich9pciFindBridge(&pGlobals->aPciBus, pAddr->iBus);332 PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(&pGlobals->aPciBus, pAddr->iBus); 333 333 if (pBridgeDevice) 334 334 { … … 344 344 else /* forward to directly connected device */ 345 345 { 346 R3PTRTYPE(P CIDevice*) pPciDev = pGlobals->aPciBus.apDevices[pAddr->iDeviceFunc];346 R3PTRTYPE(PDMPCIDEV *) pPciDev = pGlobals->aPciBus.apDevices[pAddr->iDeviceFunc]; 347 347 if (pPciDev) 348 348 { … … 443 443 { 444 444 #ifdef IN_RING3 /** @todo do lookup in R0/RC too! */ 445 PP CIDEVICEpBridgeDevice = ich9pciFindBridge(&pGlobals->aPciBus, pPciAddr->iBus);445 PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(&pGlobals->aPciBus, pPciAddr->iBus); 446 446 if (pBridgeDevice) 447 447 { … … 460 460 else /* forward to directly connected device */ 461 461 { 462 R3PTRTYPE(P CIDevice*) pPciDev = pGlobals->aPciBus.apDevices[pPciAddr->iDeviceFunc];462 R3PTRTYPE(PDMPCIDEV *) pPciDev = pGlobals->aPciBus.apDevices[pPciAddr->iDeviceFunc]; 463 463 if (pPciDev) 464 464 { … … 575 575 } 576 576 577 static void ich9pciApicSetIrq(PICH9PCIBUS pBus, uint8_t uDevFn, P CIDevice*pPciDev, int irq_num1, int iLevel,577 static void ich9pciApicSetIrq(PICH9PCIBUS pBus, uint8_t uDevFn, PDMPCIDEV *pPciDev, int irq_num1, int iLevel, 578 578 uint32_t uTagSrc, int iForcedIrq) 579 579 { … … 618 618 } 619 619 620 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PP CIDEVICEpPciDev,620 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PPDMPCIDEV pPciDev, 621 621 int iIrq, int iLevel, uint32_t uTagSrc) 622 622 { … … 789 789 790 790 791 DECLINLINE(PP CIDEVICE) ich9pciFindBridge(PICH9PCIBUS pBus, uint8_t iBus)791 DECLINLINE(PPDMPCIDEV) ich9pciFindBridge(PICH9PCIBUS pBus, uint8_t iBus) 792 792 { 793 793 /* Search for a fitting bridge. */ … … 798 798 * If the target bus is in the range we pass the request on to the bridge. 799 799 */ 800 PP CIDEVICEpBridge = pBus->papBridgesR3[iBridge];800 PPDMPCIDEV pBridge = pBus->papBridgesR3[iBridge]; 801 801 AssertMsg(pBridge && pciDevIsPci2PciBridge(pBridge), 802 802 ("Device is not a PCI bridge but on the list of PCI bridges\n")); … … 840 840 #define INVALID_PCI_ADDRESS ~0U 841 841 842 static int ich9pciUnmapRegion(PP CIDEVICEpDev, int iRegion)842 static int ich9pciUnmapRegion(PPDMPCIDEV pDev, int iRegion) 843 843 { 844 844 PCIIORegion* pRegion = &pDev->Int.s.aIORegions[iRegion]; … … 877 877 } 878 878 879 static void ich9pciUpdateMappings(P CIDevice* pDev)879 static void ich9pciUpdateMappings(PDMPCIDEV* pDev) 880 880 { 881 881 uint64_t uLast, uNew; … … 962 962 963 963 964 static DECLCALLBACK(int) ich9pciRegisterMsi(PPDMDEVINS pDevIns, PP CIDEVICEpPciDev, PPDMMSIREG pMsiReg)964 static DECLCALLBACK(int) ich9pciRegisterMsi(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, PPDMMSIREG pMsiReg) 965 965 { 966 966 NOREF(pDevIns); … … 979 979 980 980 981 static DECLCALLBACK(int) ich9pciIORegionRegister(PPDMDEVINS pDevIns, PP CIDEVICEpPciDev, int iRegion, RTGCPHYS cbRegion,981 static DECLCALLBACK(int) ich9pciIORegionRegister(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iRegion, RTGCPHYS cbRegion, 982 982 PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback) 983 983 { … … 1036 1036 } 1037 1037 1038 static DECLCALLBACK(void) ich9pciSetConfigCallbacks(PPDMDEVINS pDevIns, PP CIDEVICEpPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,1038 static DECLCALLBACK(void) ich9pciSetConfigCallbacks(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld, 1039 1039 PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld) 1040 1040 { … … 1057 1057 for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++) 1058 1058 { 1059 PP CIDEVICEpDev = pBus->apDevices[i];1059 PPDMPCIDEV pDev = pBus->apDevices[i]; 1060 1060 if (pDev) 1061 1061 { … … 1140 1140 if (iBus != PCIDevGetByte(&pBus->aPciDev, VBOX_PCI_SECONDARY_BUS)) 1141 1141 { 1142 PP CIDEVICEpBridgeDevice = ich9pciFindBridge(pBus, iBus);1142 PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(pBus, iBus); 1143 1143 if (pBridgeDevice) 1144 1144 { … … 1150 1150 { 1151 1151 /* This is the target bus, pass the write to the device. */ 1152 PP CIDEVICEpPciDev = pBus->apDevices[iDevice];1152 PPDMPCIDEV pPciDev = pBus->apDevices[iDevice]; 1153 1153 if (pPciDev) 1154 1154 { … … 1169 1169 if (iBus != PCIDevGetByte(&pBus->aPciDev, VBOX_PCI_SECONDARY_BUS)) 1170 1170 { 1171 PP CIDEVICEpBridgeDevice = ich9pciFindBridge(pBus, iBus);1171 PPDMPCIDEV pBridgeDevice = ich9pciFindBridge(pBus, iBus); 1172 1172 if (pBridgeDevice) 1173 1173 { … … 1181 1181 { 1182 1182 /* This is the target bus, pass the read to the device. */ 1183 PP CIDEVICEpPciDev = pBus->apDevices[iDevice];1183 PPDMPCIDEV pPciDev = pBus->apDevices[iDevice]; 1184 1184 if (pPciDev) 1185 1185 { … … 1202 1202 * @param fIsBridge Whether this is a bridge device or not. 1203 1203 */ 1204 static void pciR3CommonRestoreConfig(PP CIDEVICEpDev, uint8_t const *pbSrcConfig, bool fIsBridge)1204 static void pciR3CommonRestoreConfig(PPDMPCIDEV pDev, uint8_t const *pbSrcConfig, bool fIsBridge) 1205 1205 { 1206 1206 /* … … 1391 1391 for (i = 0; i < RT_ELEMENTS(pBus->apDevices); i++) 1392 1392 { 1393 PP CIDEVICEpDev = pBus->apDevices[i];1393 PPDMPCIDEV pDev = pBus->apDevices[i]; 1394 1394 if (pDev) 1395 1395 { … … 1409 1409 for (i = 0;; i++) 1410 1410 { 1411 PP CIDEVICEpDev;1412 P CIDEVICEDevTmp;1411 PPDMPCIDEV pDev; 1412 PDMPCIDEV DevTmp; 1413 1413 1414 1414 /* index / terminator */ … … 1855 1855 while (1) 1856 1856 { 1857 PP CIDEVICEpBridge = ich9pciFindBridge(pBus, uBus);1857 PPDMPCIDEV pBridge = ich9pciFindBridge(pBus, uBus); 1858 1858 if (!pBridge) 1859 1859 { … … 1899 1899 unsigned uBusSecondary) 1900 1900 { 1901 PP CIDEVICEpBridgeDev = &pBus->aPciDev;1901 PPDMPCIDEV pBridgeDev = &pBus->aPciDev; 1902 1902 1903 1903 /* Set only if we are not on the root bus, it has no primary bus attached. */ … … 1910 1910 for (uint32_t iBridge = 0; iBridge < pBus->cBridges; iBridge++) 1911 1911 { 1912 PP CIDEVICEpBridge = pBus->papBridgesR3[iBridge];1912 PPDMPCIDEV pBridge = pBus->papBridgesR3[iBridge]; 1913 1913 AssertMsg(pBridge && pciDevIsPci2PciBridge(pBridge), 1914 1914 ("Device is not a PCI bridge but on the list of PCI bridges\n")); … … 2238 2238 for (uint32_t iDev = 0; iDev < RT_ELEMENTS(pBus->apDevices); iDev++) 2239 2239 { 2240 PP CIDEVICEpPciDev = pBus->apDevices[iDev];2240 PPDMPCIDEV pPciDev = pBus->apDevices[iDev]; 2241 2241 if (pPciDev != NULL) 2242 2242 { … … 2451 2451 pGlobals->aPciBus.pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns); 2452 2452 pGlobals->aPciBus.pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 2453 pGlobals->aPciBus.papBridgesR3 = (PP CIDEVICE *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPCIDEVICE) * RT_ELEMENTS(pGlobals->aPciBus.apDevices));2453 pGlobals->aPciBus.papBridgesR3 = (PPDMPCIDEV *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPDMPCIDEV) * RT_ELEMENTS(pGlobals->aPciBus.apDevices)); 2454 2454 2455 2455 /* … … 2570 2570 } 2571 2571 2572 static void ich9pciResetDevice(PP CIDEVICEpDev)2572 static void ich9pciResetDevice(PPDMPCIDEV pDev) 2573 2573 { 2574 2574 /* Clear regions */ … … 2645 2645 } 2646 2646 2647 static void ich9pciRelocateDevice(PP CIDEVICEpDev, RTGCINTPTR offDelta)2647 static void ich9pciRelocateDevice(PPDMPCIDEV pDev, RTGCINTPTR offDelta) 2648 2648 { 2649 2649 if (pDev) … … 2710 2710 pBus->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns); 2711 2711 pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 2712 pBus->papBridgesR3 = (PP CIDEVICE *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPCIDEVICE) * RT_ELEMENTS(pBus->apDevices));2712 pBus->papBridgesR3 = (PPDMPCIDEV *)PDMDevHlpMMHeapAllocZ(pDevIns, sizeof(PPDMPCIDEV) * RT_ELEMENTS(pBus->apDevices)); 2713 2713 2714 2714 PDMPCIBUSREG PciBusReg;
Note:
See TracChangeset
for help on using the changeset viewer.