svn commit: r292062 - in head/sys/arm64: arm64 cavium include
Andrew Turner
andrew at FreeBSD.org
Thu Dec 10 13:19:32 UTC 2015
Author: andrew
Date: Thu Dec 10 13:19:30 2015
New Revision: 292062
URL: https://svnweb.freebsd.org/changeset/base/292062
Log:
Reduce the numbers of levels of indirection in arm64 pcib drivers by making
the MSI & MSI-X handler functions be directly callable from the driver
methods.
Sponsored by: ABT Systems Ltd
Modified:
head/sys/arm64/arm64/intr_machdep.c
head/sys/arm64/cavium/thunder_pcie.c
head/sys/arm64/cavium/thunder_pcie_common.c
head/sys/arm64/cavium/thunder_pcie_pem.c
head/sys/arm64/include/intr.h
Modified: head/sys/arm64/arm64/intr_machdep.c
==============================================================================
--- head/sys/arm64/arm64/intr_machdep.c Thu Dec 10 12:12:47 2015 (r292061)
+++ head/sys/arm64/arm64/intr_machdep.c Thu Dec 10 13:19:30 2015 (r292062)
@@ -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));
}
/*
Modified: head/sys/arm64/cavium/thunder_pcie.c
==============================================================================
--- head/sys/arm64/cavium/thunder_pcie.c Thu Dec 10 12:12:47 2015 (r292061)
+++ head/sys/arm64/cavium/thunder_pcie.c Thu Dec 10 13:19:30 2015 (r292062)
@@ -571,11 +571,12 @@ static device_method_t thunder_pcie_meth
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
};
Modified: head/sys/arm64/cavium/thunder_pcie_common.c
==============================================================================
--- head/sys/arm64/cavium/thunder_pcie_common.c Thu Dec 10 12:12:47 2015 (r292061)
+++ head/sys/arm64/cavium/thunder_pcie_common.c Thu Dec 10 13:19:30 2015 (r292062)
@@ -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)
{
Modified: head/sys/arm64/cavium/thunder_pcie_pem.c
==============================================================================
--- head/sys/arm64/cavium/thunder_pcie_pem.c Thu Dec 10 12:12:47 2015 (r292061)
+++ head/sys/arm64/cavium/thunder_pcie_pem.c Thu Dec 10 13:19:30 2015 (r292062)
@@ -165,11 +165,12 @@ static device_method_t thunder_pem_metho
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
};
Modified: head/sys/arm64/include/intr.h
==============================================================================
--- head/sys/arm64/include/intr.h Thu Dec 10 12:12:47 2015 (r292061)
+++ head/sys/arm64/include/intr.h Thu Dec 10 13:19:30 2015 (r292062)
@@ -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 *);
More information about the svn-src-head
mailing list