Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/mips/nexus.c
Show First 20 Lines • Show All 426 Lines • ▼ Show 20 Lines | if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { | ||||
if (err != 0) { | if (err != 0) { | ||||
rman_deactivate_resource(r); | rman_deactivate_resource(r); | ||||
return (err); | return (err); | ||||
} | } | ||||
rman_set_virtual(r, vaddr); | rman_set_virtual(r, vaddr); | ||||
rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); | rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); | ||||
} else if (type == SYS_RES_IRQ) { | } else if (type == SYS_RES_IRQ) { | ||||
#ifdef INTRNG | #ifdef INTRNG | ||||
#ifdef FDT | |||||
intr_activate_irq(child, r); | intr_activate_irq(child, r); | ||||
#else | |||||
/* | |||||
* INTRNG without FDT needs to have the interrupt properly | |||||
* mapped first. cpu_create_intr_map() will do that and | |||||
* call intr_activate_irq() at the end. | |||||
*/ | |||||
cpu_create_intr_map(rman_get_start(r)); | |||||
#endif | #endif | ||||
#endif | |||||
} | } | ||||
return (rman_activate_resource(r)); | return (rman_activate_resource(r)); | ||||
} | } | ||||
static int | static int | ||||
nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, | nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, | ||||
struct resource *r) | struct resource *r) | ||||
Show All 16 Lines | #endif | ||||
return (rman_deactivate_resource(r)); | return (rman_deactivate_resource(r)); | ||||
} | } | ||||
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) | ||||
{ | { | ||||
#ifdef INTRNG | #ifdef INTRNG | ||||
return (intr_setup_irq(child, res, filt, intr, arg, flags, cookiep)); | struct resource *r = res; | ||||
#ifndef FDT | |||||
r = cpu_get_irq_resource(rman_get_start(r)); | |||||
#endif | |||||
return (intr_setup_irq(child, r, filt, intr, arg, flags, cookiep)); | |||||
#else | #else | ||||
int irq; | int irq; | ||||
register_t s; | register_t s; | ||||
s = intr_disable(); | s = intr_disable(); | ||||
irq = rman_get_start(res); | irq = rman_get_start(res); | ||||
if (irq >= NUM_MIPS_IRQS) { | if (irq >= NUM_MIPS_IRQS) { | ||||
intr_restore(s); | intr_restore(s); | ||||
▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines |