Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/nexus.c
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | nexus_init_resources(void) | ||||
if (rman_init(&irq_rman)) | if (rman_init(&irq_rman)) | ||||
panic("nexus_init_resources irq_rman"); | panic("nexus_init_resources irq_rman"); | ||||
/* | /* | ||||
* We search for regions of existing IRQs and add those to the IRQ | * We search for regions of existing IRQs and add those to the IRQ | ||||
* resource manager. | * resource manager. | ||||
*/ | */ | ||||
for (irq = 0; irq < num_io_irqs; irq++) | for (irq = 0; irq < num_io_irqs; irq++) | ||||
if (intr_lookup_source(irq) != NULL) | if (intrtab_lookup(irq) != NULL) | ||||
if (rman_manage_region(&irq_rman, irq, irq) != 0) | if (rman_manage_region(&irq_rman, irq, irq) != 0) | ||||
panic("nexus_init_resources irq_rman add"); | panic("nexus_init_resources irq_rman add"); | ||||
/* | /* | ||||
* ISA DMA on PCI systems is implemented in the ISA part of each | * ISA DMA on PCI systems is implemented in the ISA part of each | ||||
* PCI->ISA bridge and the channels can be duplicated if there are | * PCI->ISA bridge and the channels can be duplicated if there are | ||||
* multiple bridges. (eg: laptops with docking stations) | * multiple bridges. (eg: laptops with docking stations) | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 341 Lines • ▼ Show 20 Lines | nexus_setup_intr(device_t bus, device_t child, struct resource *irq, | ||||
* We depend here on rman_activate_resource() being idempotent. | * We depend here on rman_activate_resource() being idempotent. | ||||
*/ | */ | ||||
error = rman_activate_resource(irq); | error = rman_activate_resource(irq); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
if (bus_get_domain(child, &domain) != 0) | if (bus_get_domain(child, &domain) != 0) | ||||
domain = 0; | domain = 0; | ||||
isrc = intr_lookup_source(rman_get_start(irq)); | isrc = intrtab_lookup(rman_get_start(irq)); | ||||
if (isrc == NULL) | if (isrc == NULL) | ||||
return (EINVAL); | return (EINVAL); | ||||
error = intr_add_handler(device_get_nameunit(child), isrc, | error = intr_add_handler(device_get_nameunit(child), isrc, | ||||
filter, ihand, arg, flags, cookiep, domain); | filter, ihand, arg, flags, cookiep, domain); | ||||
if (error == 0) | if (error == 0) | ||||
rman_set_irq_cookie(irq, *cookiep); | rman_set_irq_cookie(irq, *cookiep); | ||||
return (error); | return (error); | ||||
Show All 23 Lines | |||||
} | } | ||||
#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) | ||||
{ | { | ||||
struct intsrc *isrc; | struct intsrc *isrc; | ||||
isrc = intr_lookup_source(rman_get_start(irq)); | isrc = intrtab_lookup(rman_get_start(irq)); | ||||
if (isrc == NULL) | if (isrc == NULL) | ||||
return (EINVAL); | return (EINVAL); | ||||
return (intr_event_bind(isrc->is_event, cpu)); | return (intr_event_bind(isrc->is_event, cpu)); | ||||
} | } | ||||
#endif | #endif | ||||
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) | ||||
{ | { | ||||
struct intsrc *isrc; | struct intsrc *isrc; | ||||
isrc = intr_lookup_source(irq); | isrc = intrtab_lookup(irq); | ||||
if (isrc == NULL) | if (isrc == NULL) | ||||
return (EINVAL); | return (EINVAL); | ||||
return (intr_config_intr(isrc, trig, pol)); | return (intr_config_intr(isrc, trig, pol)); | ||||
} | } | ||||
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) | ||||
{ | { | ||||
struct intsrc *isrc; | struct intsrc *isrc; | ||||
isrc = intr_lookup_source(rman_get_start(irq)); | isrc = intrtab_lookup(rman_get_start(irq)); | ||||
if (isrc == NULL) | if (isrc == NULL) | ||||
return (EINVAL); | return (EINVAL); | ||||
return (intr_describe(isrc, cookie, descr)); | return (intr_describe(isrc, cookie, descr)); | ||||
} | } | ||||
static struct resource_list * | static struct resource_list * | ||||
nexus_get_reslist(device_t dev, device_t child) | nexus_get_reslist(device_t dev, device_t child) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines |