Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/nexus.c
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
static int nexus_teardown_intr(device_t, device_t, struct resource *, | static int nexus_teardown_intr(device_t, device_t, struct resource *, | ||||
void *); | void *); | ||||
static struct resource_list *nexus_get_reslist(device_t dev, device_t child); | static struct resource_list *nexus_get_reslist(device_t dev, device_t child); | ||||
static int nexus_set_resource(device_t, device_t, int, int, | static int nexus_set_resource(device_t, device_t, int, int, | ||||
rman_res_t, rman_res_t); | rman_res_t, rman_res_t); | ||||
static int nexus_get_resource(device_t, device_t, int, int, | static int nexus_get_resource(device_t, device_t, int, int, | ||||
rman_res_t *, rman_res_t *); | rman_res_t *, rman_res_t *); | ||||
static void nexus_delete_resource(device_t, device_t, int, int); | static void nexus_delete_resource(device_t, device_t, int, int); | ||||
static int nexus_get_cpus(device_t, device_t, enum cpu_sets, cpuset_t *, int size); | |||||
#ifdef DEV_APIC | #ifdef DEV_APIC | ||||
static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); | static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); | ||||
static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); | static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs); | ||||
static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq); | static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq); | ||||
static int nexus_release_msix(device_t pcib, device_t dev, int irq); | static int nexus_release_msix(device_t pcib, device_t dev, int irq); | ||||
static int nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); | static int nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); | ||||
#endif | #endif | ||||
Show All 20 Lines | #ifdef SMP | ||||
DEVMETHOD(bus_bind_intr, nexus_bind_intr), | DEVMETHOD(bus_bind_intr, nexus_bind_intr), | ||||
#endif | #endif | ||||
DEVMETHOD(bus_config_intr, nexus_config_intr), | DEVMETHOD(bus_config_intr, nexus_config_intr), | ||||
DEVMETHOD(bus_describe_intr, nexus_describe_intr), | DEVMETHOD(bus_describe_intr, nexus_describe_intr), | ||||
DEVMETHOD(bus_get_resource_list, nexus_get_reslist), | DEVMETHOD(bus_get_resource_list, nexus_get_reslist), | ||||
DEVMETHOD(bus_set_resource, nexus_set_resource), | DEVMETHOD(bus_set_resource, nexus_set_resource), | ||||
DEVMETHOD(bus_get_resource, nexus_get_resource), | DEVMETHOD(bus_get_resource, nexus_get_resource), | ||||
DEVMETHOD(bus_delete_resource, nexus_delete_resource), | DEVMETHOD(bus_delete_resource, nexus_delete_resource), | ||||
DEVMETHOD(bus_get_cpus, nexus_get_cpus), | |||||
/* pcib interface */ | /* pcib interface */ | ||||
#ifdef DEV_APIC | #ifdef DEV_APIC | ||||
DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi), | DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi), | ||||
DEVMETHOD(pcib_release_msi, nexus_release_msi), | DEVMETHOD(pcib_release_msi, nexus_release_msi), | ||||
DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix), | DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix), | ||||
DEVMETHOD(pcib_release_msix, nexus_release_msix), | DEVMETHOD(pcib_release_msix, nexus_release_msix), | ||||
DEVMETHOD(pcib_map_msi, nexus_map_msi), | DEVMETHOD(pcib_map_msi, nexus_map_msi), | ||||
▲ Show 20 Lines • Show All 434 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
nexus_delete_resource(device_t dev, device_t child, int type, int rid) | nexus_delete_resource(device_t dev, device_t child, int type, int rid) | ||||
{ | { | ||||
struct nexus_device *ndev = DEVTONX(child); | struct nexus_device *ndev = DEVTONX(child); | ||||
struct resource_list *rl = &ndev->nx_resources; | struct resource_list *rl = &ndev->nx_resources; | ||||
resource_list_delete(rl, type, rid); | resource_list_delete(rl, type, rid); | ||||
} | |||||
static int | |||||
nexus_get_cpus(device_t dev, device_t child, enum cpu_sets op, cpuset_t *cpuset, int size) | |||||
{ | |||||
switch (op) { | |||||
#ifdef SMP | |||||
case INTR_CPUS: | |||||
*cpuset = intr_cpus; | |||||
return (0); | |||||
#endif | |||||
default: | |||||
return (bus_generic_get_cpus(dev, child, op, cpuset, size)); | |||||
} | |||||
} | } | ||||
/* Called from the MSI code to add new IRQs to the IRQ rman. */ | /* Called from the MSI code to add new IRQs to the IRQ rman. */ | ||||
void | void | ||||
nexus_add_irq(u_long irq) | nexus_add_irq(u_long irq) | ||||
{ | { | ||||
if (rman_manage_region(&irq_rman, irq, irq) != 0) | if (rman_manage_region(&irq_rman, irq, irq) != 0) | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |