diff options
author | piso <piso@FreeBSD.org> | 2007-02-23 12:19:07 +0000 |
---|---|---|
committer | piso <piso@FreeBSD.org> | 2007-02-23 12:19:07 +0000 |
commit | 6a2ffa86e5b748ba71e36d37462a936eb9101be7 (patch) | |
tree | 10833d4edb6c0d0a5efcf7762d842a4c378404b0 /sys/sparc64/fhc | |
parent | 7b48c9d78377cdb9fc6e8bcc5406e28819aef6e3 (diff) | |
download | FreeBSD-src-6a2ffa86e5b748ba71e36d37462a936eb9101be7.zip FreeBSD-src-6a2ffa86e5b748ba71e36d37462a936eb9101be7.tar.gz |
o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()
o add an int return code to all fast handlers
o retire INTR_FAST/IH_FAST
For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current
Reviewed by: many
Approved by: re@
Diffstat (limited to 'sys/sparc64/fhc')
-rw-r--r-- | sys/sparc64/fhc/fhc.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/sparc64/fhc/fhc.c b/sys/sparc64/fhc/fhc.c index 53497a7..a7972c8 100644 --- a/sys/sparc64/fhc/fhc.c +++ b/sys/sparc64/fhc/fhc.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sparc64/sbus/ofw_sbus.h> struct fhc_clr { - driver_intr_t *fc_func; + driver_filter_t *fc_func; void *fc_arg; void *fc_cookie; bus_space_tag_t fc_bt; @@ -62,7 +62,7 @@ struct fhc_devinfo { struct resource_list fdi_rl; }; -static void fhc_intr_stub(void *); +static int fhc_intr_stub(void *); static void fhc_led_func(void *, int); static int fhc_print_res(struct fhc_devinfo *); @@ -206,7 +206,7 @@ fhc_probe_nomatch(device_t dev, device_t child) int fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - driver_intr_t *func, void *arg, void **cookiep) + driver_filter_t *filt, driver_intr_t *func, void *arg, void **cookiep) { struct fhc_softc *sc; struct fhc_clr *fc; @@ -217,6 +217,9 @@ fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags, long vec; uint32_t inr; + if (filt != NULL && func != NULL) + return (EINVAL); + sc = device_get_softc(bus); vec = rman_get_start(r); @@ -238,7 +241,7 @@ fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags, fc = malloc(sizeof(*fc), M_DEVBUF, M_WAITOK | M_ZERO); if (fc == NULL) return (0); - fc->fc_func = func; + fc->fc_func = (filt != NULL) ? filt : (driver_filter_t *)func; fc->fc_arg = arg; fc->fc_bt = bt; fc->fc_bh = bh; @@ -246,8 +249,12 @@ fhc_setup_intr(device_t bus, device_t child, struct resource *r, int flags, bus_space_write_4(bt, bh, FHC_IMAP, inr); bus_space_read_4(bt, bh, FHC_IMAP); - error = bus_generic_setup_intr(bus, child, r, flags, fhc_intr_stub, - fc, cookiep); + if (filt != NULL) + error = bus_generic_setup_intr(bus, child, r, flags, + fhc_intr_stub, NULL, fc, cookiep); + else + error = bus_generic_setup_intr(bus, child, r, flags, + NULL, (driver_intr_t *)fhc_intr_stub, fc, cookiep); if (error != 0) { free(fc, M_DEVBUF); return (error); @@ -276,7 +283,7 @@ fhc_teardown_intr(device_t bus, device_t child, struct resource *r, return (error); } -static void +static int fhc_intr_stub(void *arg) { struct fhc_clr *fc = arg; @@ -285,6 +292,7 @@ fhc_intr_stub(void *arg) bus_space_write_4(fc->fc_bt, fc->fc_bh, FHC_ICLR, 0x0); bus_space_read_4(fc->fc_bt, fc->fc_bh, FHC_ICLR); + return (FILTER_HANDLED); } struct resource * |