Lines Matching refs:pPciDev

216 PDMBOTHCBDECL(void) pciSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTag);
217 PDMBOTHCBDECL(void) pcibridgeSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTag);
603 static void apic_set_irq(PPCIBUS pBus, uint8_t uDevFn, PCIDevice *pPciDev, int irq_num1, int iLevel, int acpi_irq, uint32_t uTagSrc)
621 R3STRING(pPciDev->name), irq_num1, iLevel, apic_irq, apic_level, irq_num));
626 pPciDev->Int.s.uIrqPinState = PDM_IRQ_LEVEL_LOW;
629 R3STRING(pPciDev->name), irq_num1, iLevel, apic_irq, apic_level, irq_num));
634 R3STRING(pPciDev->name), irq_num1, iLevel, acpi_irq));
649 * @param pPciDev The PCI device structure which raised the interrupt.
653 * @remark uDevFn and pPciDev->devfn are not the same if the device is behind a bridge.
657 static void pciSetIrqInternal(PPCIGLOBALS pGlobals, uint8_t uDevFn, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
661 const bool fIsAcpiDevice = pPciDev->config[2] == 0x13 && pPciDev->config[3] == 0x71;
670 if (pPciDev->Int.s.uIrqPinState != iLevel)
672 pPciDev->Int.s.uIrqPinState = (iLevel & PDM_IRQ_LEVEL_HIGH);
685 apic_set_irq(pBus, uDevFn, pPciDev, -1, iLevel, pPciDev->config[PCI_INTERRUPT_LINE], uTagSrc);
687 apic_set_irq(pBus, uDevFn, pPciDev, iIrq, iLevel, -1, uTagSrc);
694 pic_irq = pPciDev->config[PCI_INTERRUPT_LINE];
703 if (pPciDev->Int.s.uIrqPinState == PDM_IRQ_LEVEL_HIGH)
705 else if (pPciDev->Int.s.uIrqPinState == PDM_IRQ_LEVEL_LOW)
715 pPciDev->Int.s.uIrqPinState = PDM_IRQ_LEVEL_LOW;
736 R3STRING(pPciDev->name), iLevel, iIrq, pic_irq, pic_level, uTagSrc));
741 pciSetIrqInternal(pGlobals, uDevFn, pPciDev, iIrq, PDM_IRQ_LEVEL_LOW, uTagSrc);
749 PDMBOTHCBDECL(void) pciSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
751 pciSetIrqInternal(PDMINS_2_DATA(pDevIns, PPCIGLOBALS), pPciDev->devfn, pPciDev, iIrq, iLevel, uTagSrc);
1612 * @param pPciDev The PCI device structure.
1615 static int pciR3RegisterDeviceInternal(PPCIBUS pBus, int iDev, PPCIDEVICE pPciDev, const char *pszName)
1653 pciDevClearRequestedDevfunc(pPciDev);
1718 pciDevSetRequestedDevfunc(pPciDev);
1722 pPciDev->devfn = iDev;
1723 pPciDev->name = pszName;
1724 pPciDev->Int.s.pBusR3 = pBus;
1725 pPciDev->Int.s.pBusR0 = MMHyperR3ToR0(PDMDevHlpGetVM(pBus->CTX_SUFF(pDevIns)), pBus);
1726 pPciDev->Int.s.pBusRC = MMHyperR3ToRC(PDMDevHlpGetVM(pBus->CTX_SUFF(pDevIns)), pBus);
1727 pPciDev->Int.s.pfnConfigRead = pci_default_read_config;
1728 pPciDev->Int.s.pfnConfigWrite = pci_default_write_config;
1729 pBus->devices[iDev] = pPciDev;
1730 if (pciDevIsPci2PciBridge(pPciDev))
1733 AssertMsg(pPciDev->Int.s.pfnBridgeConfigRead && pPciDev->Int.s.pfnBridgeConfigWrite,
1735 pBus->papBridgesR3[pBus->cBridges] = pPciDev;
1749 static DECLCALLBACK(int) pciR3Register(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, const char *pszName, int iDev)
1757 || !pPciDev
1761 AssertMsgFailed(("Invalid argument! pszName=%s pPciDev=%p iDev=%d\n", pszName, pPciDev, iDev));
1768 return pciR3RegisterDeviceInternal(pBus, iDev, pPciDev, pszName);
1775 static DECLCALLBACK(int) pciR3CommonIORegionRegister(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iRegion, uint32_t cbRegion,
1800 PPCIIOREGION pRegion = &pPciDev->Int.s.aIORegions[iRegion];
1810 *(uint32_t *)(pPciDev->config + u32Address) = RT_H2LE_U32(u32Value);
1820 pciR3CommonSetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
1826 *ppfnReadOld = pPciDev->Int.s.pfnConfigRead;
1827 pPciDev->Int.s.pfnConfigRead = pfnRead;
1830 *ppfnWriteOld = pPciDev->Int.s.pfnConfigWrite;
1831 pPciDev->Int.s.pfnConfigWrite = pfnWrite;
1941 PPCIDEVICE pPciDev = pBus->devices[iDev];
1942 if (pPciDev != NULL)
1952 pPciDev->name,
1953 pciDevIsPassthrough(pPciDev) ? " (PASSTHROUGH)" : "",
1954 PCIDevGetWord(pPciDev, VBOX_PCI_VENDOR_ID), PCIDevGetWord(pPciDev, VBOX_PCI_DEVICE_ID),
1955 pciDevIsMsiCapable(pPciDev) ? " MSI" : "",
1956 pciDevIsMsixCapable(pPciDev) ? " MSI-X" : ""
1958 if (PCIDevGetByte(pPciDev, VBOX_PCI_INTERRUPT_PIN) != 0)
1959 pHlp->pfnPrintf(pHlp, " IRQ%d", PCIDevGetByte(pPciDev, VBOX_PCI_INTERRUPT_LINE));
1963 uint16_t iCmd = PCIDevGetWord(pPciDev, VBOX_PCI_COMMAND);
1968 PCIIORegion* pRegion = &pPciDev->Int.s.aIORegions[iRegion];
1974 uint32_t u32Addr = PCIDevGetDWord(pPciDev, PCIDevGetRegionReg(iRegion));
2002 uint16_t iStatus = PCIDevGetWord(pPciDev, VBOX_PCI_STATUS);
2021 pHlp->pfnPrintf(pHlp, "%02x ", PCIDevGetByte(pPciDev, iReg++));
2310 PDMBOTHCBDECL(void) pcibridgeSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
2320 PPCIDEVICE pPciDevBus = pPciDev;
2336 pciSetIrqInternal(PCIBUS_2_PCIGLOBALS(pBus), uDevFnBridge, pPciDev, iIrqPinBridge, iLevel, uTagSrc);
2363 PPCIDEVICE pPciDev = pBus->devices[iDevice];
2364 if (pPciDev)
2366 Log(("%s: %s: addr=%02x val=%08x len=%d\n", __FUNCTION__, pPciDev->name, u32Address, u32Value, cb));
2367 pPciDev->Int.s.pfnConfigWrite(pPciDev, u32Address, u32Value, cb);
2396 PPCIDEVICE pPciDev = pBus->devices[iDevice];
2397 if (pPciDev)
2399 u32Value = pPciDev->Int.s.pfnConfigRead(pPciDev, u32Address, cb);
2400 Log(("%s: %s: u32Address=%02x u32Value=%08x cb=%d\n", __FUNCTION__, pPciDev->name, u32Address, u32Value, cb));
2433 static DECLCALLBACK(int) pcibridgeR3RegisterDevice(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, const char *pszName, int iDev)
2441 || !pPciDev
2444 AssertMsgFailed(("Invalid argument! pszName=%s pPciDev=%p iDev=%d\n", pszName, pPciDev, iDev));
2451 return pciR3RegisterDeviceInternal(pBus, iDev, pPciDev, pszName);