static int ocpbus_setup_intr(device_t dev, device_t child, struct resource *res, int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep) { int error; if (res == NULL) panic("ocpbus_setup_intr: NULL irq resource!"); *cookiep = 0; if ((rman_get_flags(res) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; /* * We depend here on rman_activate_resource() being idempotent. */ error = rman_activate_resource(res); if (error) return (error); error = powerpc_setup_intr(device_get_nameunit(child), rman_get_start(res), filter, ihand, arg, flags, cookiep); return (error); }
static int nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { int error, domain; if (r == NULL) panic("%s: NULL interrupt resource!", __func__); if (cookiep != NULL) *cookiep = NULL; if ((rman_get_flags(r) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; /* We depend here on rman_activate_resource() being idempotent. */ error = rman_activate_resource(r); if (error) return (error); if (bus_get_domain(child, &domain) != 0) { if(bootverbose) device_printf(child, "no domain found\n"); domain = 0; } error = powerpc_setup_intr(device_get_nameunit(child), rman_get_start(r), filt, intr, arg, flags, cookiep, domain); return (error); }
static int nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { int error; if (r == NULL) panic("%s: NULL interrupt resource!", __func__); if ((rman_get_flags(r) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; /* We depend here on rman_activate_resource() being idempotent. */ error = rman_activate_resource(r); if (error) return (error); error = powerpc_setup_intr(device_get_nameunit(child), rman_get_start(r), filt, intr, arg, flags, cookiep); return (error); }
static int nexus_setup_intr(device_t bus, device_t child, struct resource *res, int flags, driver_filter_t *ifilt, driver_intr_t *ihand, void *arg, void **cookiep) { int error; *cookiep = NULL; /* somebody tried to setup an irq that failed to allocate! */ if (res == NULL) return (EINVAL); if ((rman_get_flags(res) & RF_SHAREABLE) == 0) flags |= INTR_EXCL; /* We depend on rman_activate_resource() being idempotent. */ error = rman_activate_resource(res); if (error) return (error); error = powerpc_setup_intr(device_get_nameunit(child), rman_get_start(res), ifilt, ihand, arg, flags, cookiep); return (error); }