diff options
-rw-r--r-- | sys/arm64/arm64/intr_machdep.c | 24 | ||||
-rw-r--r-- | sys/arm64/cavium/thunder_pcie.c | 11 | ||||
-rw-r--r-- | sys/arm64/cavium/thunder_pcie_common.c | 48 | ||||
-rw-r--r-- | sys/arm64/cavium/thunder_pcie_pem.c | 11 | ||||
-rw-r--r-- | sys/arm64/include/intr.h | 12 |
5 files changed, 30 insertions, 76 deletions
diff --git a/sys/arm64/arm64/intr_machdep.c b/sys/arm64/arm64/intr_machdep.c index 7c383ee..1ae91a7 100644 --- a/sys/arm64/arm64/intr_machdep.c +++ b/sys/arm64/arm64/intr_machdep.c @@ -217,46 +217,46 @@ arm_register_msi_pic(device_t dev) } int -arm_alloc_msi(device_t pci_dev, int count, int *irqs) +arm_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { - return PIC_ALLOC_MSI(msi_pic, pci_dev, count, irqs); + return (PIC_ALLOC_MSI(msi_pic, child, count, irqs)); } int -arm_release_msi(device_t pci_dev, int count, int *irqs) +arm_release_msi(device_t pci, device_t child, int count, int *irqs) { - return PIC_RELEASE_MSI(msi_pic, pci_dev, count, irqs); + return (PIC_RELEASE_MSI(msi_pic, child, count, irqs)); } int -arm_map_msi(device_t pci_dev, int irq, uint64_t *addr, uint32_t *data) +arm_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) { - return PIC_MAP_MSI(msi_pic, pci_dev, irq, addr, data); + return (PIC_MAP_MSI(msi_pic, child, irq, addr, data)); } int -arm_alloc_msix(device_t pci_dev, int *irq) +arm_alloc_msix(device_t pci, device_t child, int *irq) { - return PIC_ALLOC_MSIX(msi_pic, pci_dev, irq); + return (PIC_ALLOC_MSIX(msi_pic, child, irq)); } int -arm_release_msix(device_t pci_dev, int irq) +arm_release_msix(device_t pci, device_t child, int irq) { - return PIC_RELEASE_MSIX(msi_pic, pci_dev, irq); + return (PIC_RELEASE_MSIX(msi_pic, child, irq)); } int -arm_map_msix(device_t pci_dev, int irq, uint64_t *addr, uint32_t *data) +arm_map_msix(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) { - return PIC_MAP_MSIX(msi_pic, pci_dev, irq, addr, data); + return (PIC_MAP_MSIX(msi_pic, child, irq, addr, data)); } /* diff --git a/sys/arm64/cavium/thunder_pcie.c b/sys/arm64/cavium/thunder_pcie.c index 1108d15..8abdacd 100644 --- a/sys/arm64/cavium/thunder_pcie.c +++ b/sys/arm64/cavium/thunder_pcie.c @@ -571,11 +571,12 @@ static device_method_t thunder_pcie_methods[] = { DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(pcib_map_msi, thunder_common_map_msi), - DEVMETHOD(pcib_alloc_msix, thunder_common_alloc_msix), - DEVMETHOD(pcib_release_msix, thunder_common_release_msix), - DEVMETHOD(pcib_alloc_msi, thunder_common_alloc_msi), - DEVMETHOD(pcib_release_msi, thunder_common_release_msi), + + DEVMETHOD(pcib_map_msi, arm_map_msi), + DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), + DEVMETHOD(pcib_release_msix, arm_release_msix), + DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), + DEVMETHOD(pcib_release_msi, arm_release_msi), DEVMETHOD_END }; diff --git a/sys/arm64/cavium/thunder_pcie_common.c b/sys/arm64/cavium/thunder_pcie_common.c index e3e75f3..59c383f 100644 --- a/sys/arm64/cavium/thunder_pcie_common.c +++ b/sys/arm64/cavium/thunder_pcie_common.c @@ -42,54 +42,6 @@ __FBSDID("$FreeBSD$"); #include "thunder_pcie_common.h" - -int -thunder_common_map_msi(device_t pcib, device_t child, int irq, - uint64_t *addr, uint32_t *data) -{ - int error; - - error = arm_map_msix(child, irq, addr, data); - return (error); -} - -int -thunder_common_alloc_msix(device_t pcib, device_t child, int *irq) -{ - int error; - - error = arm_alloc_msix(child, irq); - return (error); -} - -int -thunder_common_release_msix(device_t pcib, device_t child, int irq) -{ - int error; - - error = arm_release_msix(child, irq); - return (error); -} - -int -thunder_common_alloc_msi(device_t pcib, device_t child, int count, int maxcount, - int *irqs) -{ - int error; - - error = arm_alloc_msi(child, count, irqs); - return (error); -} - -int -thunder_common_release_msi(device_t pcib, device_t child, int count, int *irqs) -{ - int error; - - error = arm_release_msi(child, count, irqs); - return (error); -} - uint32_t range_addr_is_pci(struct pcie_range *ranges, uint64_t addr, uint64_t size) { diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c index f36057b..9ea3f77 100644 --- a/sys/arm64/cavium/thunder_pcie_pem.c +++ b/sys/arm64/cavium/thunder_pcie_pem.c @@ -165,11 +165,12 @@ static device_method_t thunder_pem_methods[] = { DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(pcib_map_msi, thunder_common_map_msi), - DEVMETHOD(pcib_alloc_msix, thunder_common_alloc_msix), - DEVMETHOD(pcib_release_msix, thunder_common_release_msix), - DEVMETHOD(pcib_alloc_msi, thunder_common_alloc_msi), - DEVMETHOD(pcib_release_msi, thunder_common_release_msi), + + DEVMETHOD(pcib_map_msi, arm_map_msi), + DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), + DEVMETHOD(pcib_release_msix, arm_release_msix), + DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), + DEVMETHOD(pcib_release_msi, arm_release_msi), DEVMETHOD_END }; diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h index 1031c64..067c69b 100644 --- a/sys/arm64/include/intr.h +++ b/sys/arm64/include/intr.h @@ -36,12 +36,12 @@ int arm_enable_intr(void); void arm_mask_irq(u_int); void arm_register_root_pic(device_t, u_int); void arm_register_msi_pic(device_t); -int arm_alloc_msi(device_t, int, int *); -int arm_release_msi(device_t, int, int *); -int arm_alloc_msix(device_t, int *); -int arm_release_msix(device_t, int); -int arm_map_msi(device_t, int, uint64_t *, uint32_t *); -int arm_map_msix(device_t, int, uint64_t *, uint32_t *); +int arm_alloc_msi(device_t, device_t, int, int, int *); +int arm_release_msi(device_t, device_t, int, int *); +int arm_alloc_msix(device_t, device_t, int *); +int arm_release_msix(device_t, device_t, int); +int arm_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +int arm_map_msix(device_t, device_t, int, uint64_t *, uint32_t *); int arm_setup_intr(const char *, driver_filter_t *, driver_intr_t, void *, u_int, enum intr_type, void **); int arm_teardown_intr(void *); |