Changeset View
Changeset View
Standalone View
Standalone View
head/sys/x86/x86/nexus.c
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | static int nexus_unmap_resource(device_t bus, device_t child, int type, | ||||
struct resource *r, struct resource_map *map); | struct resource *r, struct resource_map *map); | ||||
static int nexus_release_resource(device_t, device_t, int, int, | static int nexus_release_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static int nexus_setup_intr(device_t, device_t, struct resource *, int flags, | static int nexus_setup_intr(device_t, device_t, struct resource *, int flags, | ||||
driver_filter_t filter, void (*)(void *), void *, | driver_filter_t filter, void (*)(void *), void *, | ||||
void **); | void **); | ||||
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 int nexus_suspend_intr(device_t, device_t, struct resource *); | |||||
static int nexus_resume_intr(device_t, device_t, struct resource *); | |||||
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, size_t, | static int nexus_get_cpus(device_t, device_t, enum cpu_sets, size_t, | ||||
cpuset_t *); | cpuset_t *); | ||||
Show All 21 Lines | static device_method_t nexus_methods[] = { | ||||
DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), | DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), | ||||
DEVMETHOD(bus_release_resource, nexus_release_resource), | DEVMETHOD(bus_release_resource, nexus_release_resource), | ||||
DEVMETHOD(bus_activate_resource, nexus_activate_resource), | DEVMETHOD(bus_activate_resource, nexus_activate_resource), | ||||
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), | DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), | ||||
DEVMETHOD(bus_map_resource, nexus_map_resource), | DEVMETHOD(bus_map_resource, nexus_map_resource), | ||||
DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), | DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), | ||||
DEVMETHOD(bus_setup_intr, nexus_setup_intr), | DEVMETHOD(bus_setup_intr, nexus_setup_intr), | ||||
DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), | DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), | ||||
DEVMETHOD(bus_suspend_intr, nexus_suspend_intr), | |||||
DEVMETHOD(bus_resume_intr, nexus_resume_intr), | |||||
#ifdef SMP | #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), | ||||
▲ Show 20 Lines • Show All 418 Lines • ▼ Show 20 Lines | nexus_setup_intr(device_t bus, device_t child, struct resource *irq, | ||||
error = rman_activate_resource(irq); | error = rman_activate_resource(irq); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
if (bus_get_domain(child, &domain) != 0) | if (bus_get_domain(child, &domain) != 0) | ||||
domain = 0; | domain = 0; | ||||
error = intr_add_handler(device_get_nameunit(child), | error = intr_add_handler(device_get_nameunit(child), | ||||
rman_get_start(irq), filter, ihand, arg, flags, cookiep, domain); | rman_get_start(irq), filter, ihand, arg, flags, cookiep, domain); | ||||
if (error == 0) | |||||
rman_set_irq_cookie(irq, *cookiep); | |||||
return (error); | return (error); | ||||
} | } | ||||
static int | static int | ||||
nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) | nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) | ||||
{ | { | ||||
return (intr_remove_handler(ih)); | int error; | ||||
error = intr_remove_handler(ih); | |||||
if (error == 0) | |||||
rman_set_irq_cookie(r, NULL); | |||||
return (error); | |||||
} | |||||
static int | |||||
nexus_suspend_intr(device_t dev, device_t child, struct resource *irq) | |||||
{ | |||||
return (intr_event_suspend_handler(rman_get_irq_cookie(irq))); | |||||
} | |||||
static int | |||||
nexus_resume_intr(device_t dev, device_t child, struct resource *irq) | |||||
{ | |||||
return (intr_event_resume_handler(rman_get_irq_cookie(irq))); | |||||
} | } | ||||
#ifdef SMP | #ifdef SMP | ||||
static int | static int | ||||
nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) | nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) | ||||
{ | { | ||||
return (intr_bind(rman_get_start(irq), cpu)); | return (intr_bind(rman_get_start(irq), cpu)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 295 Lines • Show Last 20 Lines |