Lines Matching refs:pPciDev

172 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PPCIDEVICE pPciDev,
176 static int ich9pciRegisterInternal(PICH9PCIBUS pBus, int iDev, PPCIDEVICE pPciDev, const char *pszName);
200 PDMBOTHCBDECL(void) ich9pciSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
203 ich9pciSetIrqInternal(PDMINS_2_DATA(pDevIns, PICH9PCIGLOBALS), pPciDev->devfn, pPciDev, iIrq, iLevel, uTagSrc);
206 PDMBOTHCBDECL(void) ich9pcibridgeSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
216 PPCIDEVICE pPciDevBus = pPciDev;
232 ich9pciSetIrqInternal(PCIROOTBUS_2_PCIGLOBALS(pBus), uDevFnBridge, pPciDev, iIrqPinBridge, iLevel, uTagSrc);
564 static void ich9pciApicSetIrq(PICH9PCIBUS pBus, uint8_t uDevFn, PCIDevice *pPciDev, int irq_num1, int iLevel,
584 R3STRING(pPciDev->name), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));
594 pPciDev->Int.s.uIrqPinState = PDM_IRQ_LEVEL_LOW;
597 R3STRING(pPciDev->name), irq_num1, iLevel, apic_irq, apic_level, irq_num, uTagSrc));
602 R3STRING(pPciDev->name), irq_num1, iLevel, iForcedIrq, uTagSrc));
607 static void ich9pciSetIrqInternal(PICH9PCIGLOBALS pGlobals, uint8_t uDevFn, PPCIDEVICE pPciDev,
615 if (MsiIsEnabled(pPciDev))
617 Assert(!MsixIsEnabled(pPciDev)); /* Not allowed -- see note above. */
618 LogFlowFunc(("PCI Dev %p : MSI\n", pPciDev));
620 MsiNotify(pDevIns, pGlobals->aPciBus.CTX_SUFF(pPciHlp), pPciDev, iIrq, iLevel, uTagSrc);
624 if (MsixIsEnabled(pPciDev))
626 LogFlowFunc(("PCI Dev %p : MSI-X\n", pPciDev));
628 MsixNotify(pDevIns, pGlobals->aPciBus.CTX_SUFF(pPciHlp), pPciDev, iIrq, iLevel, uTagSrc);
633 const bool fIsAcpiDevice = PCIDevGetDeviceId(pPciDev) == 0x7113;
635 LogFlowFunc(("PCI Dev %p : IRQ\n", pPciDev));
637 if (pPciDev->Int.s.uIrqPinState != iLevel)
639 pPciDev->Int.s.uIrqPinState = (iLevel & PDM_IRQ_LEVEL_HIGH);
650 ich9pciApicSetIrq(pBus, uDevFn, pPciDev, -1, iLevel, uTagSrc, PCIDevGetInterruptLine(pPciDev));
652 ich9pciApicSetIrq(pBus, uDevFn, pPciDev, iIrq, iLevel, uTagSrc, -1);
939 static DECLCALLBACK(int) ich9pciRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, const char *pszName, int iDev)
947 || !pPciDev
951 AssertMsgFailed(("Invalid argument! pszName=%s pPciDev=%p iDev=%d\n", pszName, pPciDev, iDev));
958 return ich9pciRegisterInternal(pBus, iDev, pPciDev, pszName);
962 static DECLCALLBACK(int) ich9pciRegisterMsi(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PPDMMSIREG pMsiReg)
967 rc = MsiInit(pPciDev, pMsiReg);
971 rc = MsixInit(pPciDev->Int.s.CTX_SUFF(pBus)->CTX_SUFF(pPciHlp), pPciDev, pMsiReg);
979 static DECLCALLBACK(int) ich9pcibridgeRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, const char *pszName, int iDev)
988 || !pPciDev
991 AssertMsgFailed(("Invalid argument! pszName=%s pPciDev=%p iDev=%d\n", pszName, pPciDev, iDev));
998 return ich9pciRegisterInternal(pBus, iDev, pPciDev, pszName);
1001 static DECLCALLBACK(int) ich9pciIORegionRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)
1026 pPciDev->name, iRegion, cbRegion, enmType));
1029 Assert(pPciDev->Int.s.aIORegions[iRegion].type != 0xff);
1034 PPCIIOREGION pRegion = &pPciDev->Int.s.aIORegions[iRegion];
1046 pPciDev->Int.s.aIORegions[iRegion+1].type = 0xff;
1051 PCIDevSetDWord(pPciDev, ich9pciGetRegionReg(iRegion), u32Value);
1056 static DECLCALLBACK(void) ich9pciSetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
1062 *ppfnReadOld = pPciDev->Int.s.pfnConfigRead;
1063 pPciDev->Int.s.pfnConfigRead = pfnRead;
1066 *ppfnWriteOld = pPciDev->Int.s.pfnConfigWrite;
1067 pPciDev->Int.s.pfnConfigWrite = pfnWrite;
1170 PPCIDEVICE pPciDev = pBus->apDevices[iDevice];
1171 if (pPciDev)
1173 Log(("%s: %s: addr=%02x val=%08x len=%d\n", __FUNCTION__, pPciDev->name, u32Address, u32Value, cb));
1174 pPciDev->Int.s.pfnConfigWrite(pPciDev, u32Address, u32Value, cb);
1201 PPCIDEVICE pPciDev = pBus->apDevices[iDevice];
1202 if (pPciDev)
1204 u32Value = pPciDev->Int.s.pfnConfigRead(pPciDev, u32Address, cb);
1205 Log(("%s: %s: u32Address=%02x u32Value=%08x cb=%d\n", __FUNCTION__, pPciDev->name, u32Address, u32Value, cb));
2201 static bool assignPosition(PICH9PCIBUS pBus, PPCIDEVICE pPciDev, const char *pszName, int iDevFn, PciAddress* aPosition)
2226 pciDevClearRequestedDevfunc(pPciDev);
2252 static int ich9pciRegisterInternal(PICH9PCIBUS pBus, int iDev, PPCIDEVICE pPciDev, const char *pszName)
2262 if (!assignPosition(pBus, pPciDev, pszName, iDev, &aPosition))
2278 if (pciDevIsRequestedDevfunc(pPciDev) &&
2315 pPciDev->devfn = iDev;
2316 pPciDev->name = pszName;
2317 pPciDev->Int.s.pBusR3 = pBus;
2318 pPciDev->Int.s.pBusR0 = MMHyperR3ToR0(PDMDevHlpGetVM(pBus->CTX_SUFF(pDevIns)), pBus);
2319 pPciDev->Int.s.pBusRC = MMHyperR3ToRC(PDMDevHlpGetVM(pBus->CTX_SUFF(pDevIns)), pBus);
2320 pPciDev->Int.s.pfnConfigRead = ich9pciConfigReadDev;
2321 pPciDev->Int.s.pfnConfigWrite = ich9pciConfigWriteDev;
2322 pBus->apDevices[iDev] = pPciDev;
2323 if (pciDevIsPci2PciBridge(pPciDev))
2326 AssertMsg(pPciDev->Int.s.pfnBridgeConfigRead && pPciDev->Int.s.pfnBridgeConfigWrite,
2329 pBus->papBridgesR3[pBus->cBridges] = pPciDev;
2351 PPCIDEVICE pPciDev = pBus->apDevices[iDev];
2352 if (pPciDev != NULL)
2362 pPciDev->name,
2363 pciDevIsPassthrough(pPciDev) ? " (PASSTHROUGH)" : "",
2364 ich9pciGetWord(pPciDev, VBOX_PCI_VENDOR_ID), ich9pciGetWord(pPciDev, VBOX_PCI_DEVICE_ID)
2366 if (ich9pciGetByte(pPciDev, VBOX_PCI_INTERRUPT_PIN) != 0)
2367 pHlp->pfnPrintf(pHlp, " IRQ%d", ich9pciGetByte(pPciDev, VBOX_PCI_INTERRUPT_LINE));
2370 if (pciDevIsMsiCapable(pPciDev) || pciDevIsMsixCapable(pPciDev))
2374 if (pciDevIsMsiCapable(pPciDev))
2375 pHlp->pfnPrintf(pHlp, "MSI:%s ", MsiIsEnabled(pPciDev) ? "on" : "off");
2377 if (pciDevIsMsixCapable(pPciDev))
2378 pHlp->pfnPrintf(pHlp, "MSI-X:%s ", MsixIsEnabled(pPciDev) ? "on" : "off");
2383 uint16_t iCmd = ich9pciGetWord(pPciDev, VBOX_PCI_COMMAND);
2388 PCIIORegion* pRegion = &pPciDev->Int.s.aIORegions[iRegion];
2394 uint32_t u32Addr = ich9pciGetDWord(pPciDev, ich9pciGetRegionReg(iRegion));
2422 uint16_t iStatus = ich9pciGetWord(pPciDev, VBOX_PCI_STATUS);
2441 pHlp->pfnPrintf(pHlp, "%02x ", ich9pciGetByte(pPciDev, iReg++));