mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
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
This commit is contained in:
parent
ae9ef15929
commit
c1d5e7a1f1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292062
|
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
@ -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 *);
|
||||
|
|
Loading…
Reference in a new issue