Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/nexus.c
Show First 20 Lines • Show All 275 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, | nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, | ||||
enum intr_polarity pol) | enum intr_polarity pol) | ||||
{ | { | ||||
int ret = ENODEV; | int ret = ENODEV; | ||||
#ifdef ARM_INTRNG | #ifdef ARM_INTRNG | ||||
ret = intr_irq_config(irq, trig, pol); | device_printf(dev, "bus_config_intr is obsolete and not supported!\n"); | ||||
ret = EOPNOTSUPP; | |||||
andrew: The acpi code calls BUS_CONFIG_INTR. | |||||
Not Done Inline ActionsYes, I know. But if I'm not wrong, BUS_CONFIG_INTR is not called from "client" driver. It's called from some bus driver on a way up to nexus. So if such bus driver will use intrng, there is intrng-like-way how to config an interrupt. And the fact that struct resource is not an argument of this call shows, IMO, clearly how not standard (hackish) the call is. skra: Yes, I know. But if I'm not wrong, BUS_CONFIG_INTR is not called from "client" driver. It's… | |||||
#else | #else | ||||
if (arm_config_irq) | if (arm_config_irq) | ||||
ret = (*arm_config_irq)(irq, trig, pol); | ret = (*arm_config_irq)(irq, trig, pol); | ||||
#endif | #endif | ||||
return (ret); | return (ret); | ||||
} | } | ||||
static int | static int | ||||
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, | nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, | ||||
driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) | driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) | ||||
{ | { | ||||
#ifndef ARM_INTRNG | |||||
int irq; | int irq; | ||||
#endif | |||||
if ((rman_get_flags(res) & RF_SHAREABLE) == 0) | if ((rman_get_flags(res) & RF_SHAREABLE) == 0) | ||||
flags |= INTR_EXCL; | flags |= INTR_EXCL; | ||||
for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { | |||||
#ifdef ARM_INTRNG | #ifdef ARM_INTRNG | ||||
intr_irq_add_handler(child, filt, intr, arg, irq, flags, | return(intr_setup_irq(child, res, filt, intr, arg, flags, cookiep)); | ||||
cookiep); | |||||
#else | #else | ||||
for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) { | |||||
arm_setup_irqhandler(device_get_nameunit(child), | arm_setup_irqhandler(device_get_nameunit(child), | ||||
filt, intr, arg, irq, flags, cookiep); | filt, intr, arg, irq, flags, cookiep); | ||||
arm_unmask_irq(irq); | arm_unmask_irq(irq); | ||||
#endif | |||||
} | } | ||||
return (0); | return (0); | ||||
#endif | |||||
} | } | ||||
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) | ||||
{ | { | ||||
#ifdef ARM_INTRNG | #ifdef ARM_INTRNG | ||||
return (intr_irq_remove_handler(child, rman_get_start(r), ih)); | return (intr_teardown_irq(child, r, ih)); | ||||
#else | #else | ||||
return (arm_remove_irqhandler(rman_get_start(r), ih)); | return (arm_remove_irqhandler(rman_get_start(r), ih)); | ||||
#endif | #endif | ||||
} | } | ||||
#ifdef ARM_INTRNG | #ifdef ARM_INTRNG | ||||
static int | static int | ||||
nexus_describe_intr(device_t dev, device_t child, struct resource *irq, | nexus_describe_intr(device_t dev, device_t child, struct resource *irq, | ||||
void *cookie, const char *descr) | void *cookie, const char *descr) | ||||
{ | { | ||||
return (intr_irq_describe(rman_get_start(irq), cookie, descr)); | return (intr_describe_irq(child, irq, cookie, descr)); | ||||
} | } | ||||
#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_irq_bind(rman_get_start(irq), cpu)); | return (intr_bind_irq(child, irq, cpu)); | ||||
} | } | ||||
#endif | #endif | ||||
#endif | #endif | ||||
static int | static int | ||||
nexus_activate_resource(device_t bus, device_t child, int type, int rid, | nexus_activate_resource(device_t bus, device_t child, int type, int rid, | ||||
struct resource *r) | struct resource *r) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |
The acpi code calls BUS_CONFIG_INTR.