--- p4_head/sys/i386/i386/intr_machdep.c Sun Jan 21 15:19:02 2007 +++ p4_head_intr/sys/i386/i386/intr_machdep.c Fri Jan 26 13:54:09 2007 @@ -149,8 +149,8 @@ } int -intr_add_handler(const char *name, int vector, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep) +intr_add_handler(const char *name, int vector, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep) { struct intsrc *isrc; int error; @@ -158,8 +158,8 @@ isrc = intr_lookup_source(vector); if (isrc == NULL) return (EINVAL); - error = intr_event_add_handler(isrc->is_event, name, handler, arg, - intr_priority(flags), flags, cookiep); + error = intr_event_add_handler(isrc->is_event, name, filter, handler, + arg, intr_priority(flags), flags, cookiep); if (error == 0) { intrcnt_updatename(isrc); mtx_lock_spin(&intr_table_lock); @@ -257,7 +257,7 @@ thread = 0; critical_enter(); TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { - if (!(ih->ih_flags & IH_FAST)) { + if (ih->ih_filter == NULL) { thread = 1; continue; } @@ -265,7 +265,7 @@ ih->ih_handler, ih->ih_argument == NULL ? frame : ih->ih_argument, ih->ih_name); if (ih->ih_argument == NULL) - ih->ih_handler(frame); + ih->ih_filter(frame); else ih->ih_handler(ih->ih_argument); } --- p4_head/sys/i386/i386/nexus.c Sun Jan 21 15:19:03 2007 +++ p4_head_intr/sys/i386/i386/nexus.c Fri Jan 26 13:54:09 2007 @@ -102,7 +102,8 @@ static int nexus_release_resource(device_t, device_t, int, int, struct resource *); static int nexus_setup_intr(device_t, device_t, struct resource *, int flags, - void (*)(void *), void *, void **); + driver_filter_t filter, void (*)(void *), void *, + void **); static int nexus_teardown_intr(device_t, device_t, struct resource *, void *); static struct resource_list *nexus_get_reslist(device_t dev, device_t child); @@ -470,7 +471,8 @@ */ static int nexus_setup_intr(device_t bus, device_t child, struct resource *irq, - int flags, void (*ihand)(void *), void *arg, void **cookiep) + int flags, driver_filter_t filter, void (*ihand)(void *), + void *arg, void **cookiep) { int error; @@ -490,7 +492,7 @@ return (error); error = intr_add_handler(device_get_nameunit(child), - rman_get_start(irq), ihand, arg, flags, cookiep); + rman_get_start(irq), filter, ihand, arg, flags, cookiep); return (error); } --- p4_head/sys/i386/include/intr_machdep.h Sun Jan 21 15:19:06 2007 +++ p4_head_intr/sys/i386/include/intr_machdep.h Fri Jan 26 13:54:09 2007 @@ -132,8 +132,8 @@ #else #define intr_add_cpu(apic_id) #endif -int intr_add_handler(const char *name, int vector, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep); +int intr_add_handler(const char *name, int vector, driver_filter_t filter, + driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); --- p4_head/sys/i386/isa/clock.c Sun Jan 21 15:19:08 2007 +++ p4_head_intr/sys/i386/isa/clock.c Fri Jan 26 13:54:09 2007 @@ -142,7 +142,7 @@ 0 /* quality */ }; -static void +static int clkintr(struct trapframe *frame) { @@ -164,6 +164,7 @@ if (MCA_system) outb(0x61, inb(0x61) | 0x80); #endif + return (FILTER_HANDLED); } int @@ -218,7 +219,7 @@ * Stat clock ticks can still be lost, causing minor loss of accuracy * in the statistics, but the stat clock will no longer stop. */ -static void +static int rtcintr(struct trapframe *frame) { @@ -231,6 +232,7 @@ if (pscnt == psdiv) statclock(TRAPF_USERMODE(frame)); } + return (FILTER_HANDLED); } #include "opt_ddb.h" @@ -761,8 +763,8 @@ * timecounter to user a simpler algorithm. */ if (!using_lapic_timer) { - intr_add_handler("clk", 0, (driver_intr_t *)clkintr, NULL, - INTR_TYPE_CLK | INTR_FAST, NULL); + intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, + INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); if (i8254_intsrc != NULL) i8254_pending = @@ -795,8 +797,8 @@ /* Enable periodic interrupts from the RTC. */ rtc_statusb |= RTCSB_PINTR; - intr_add_handler("rtc", 8, (driver_intr_t *)rtcintr, NULL, - INTR_TYPE_CLK | INTR_FAST, NULL); + intr_add_handler("rtc", 8, (driver_filter_t *)rtcintr, NULL, NULL, + INTR_TYPE_CLK, NULL); writertc(RTC_STATUSB, rtc_statusb); rtcin(RTC_INTR); --- p4_head/sys/i386/isa/isa.c Sun Jan 21 15:19:08 2007 +++ p4_head_intr/sys/i386/isa/isa.c Fri Jan 26 13:54:09 2007 @@ -262,10 +262,11 @@ */ int isa_setup_intr(device_t bus, device_t child, struct resource *r, int flags, - void (*ihand)(void *), void *arg, void **cookiep) + driver_filter_t filter, void (*ihand)(void *), void *arg, + void **cookiep) { return (BUS_SETUP_INTR(device_get_parent(bus), child, r, flags, - ihand, arg, cookiep)); + filter, ihand, arg, cookiep)); } int --- p4_head/sys/i386/isa/npx.c Sun Jan 21 15:19:09 2007 +++ p4_head_intr/sys/i386/isa/npx.c Fri Jan 26 13:54:09 2007 @@ -149,7 +149,7 @@ static void fpurstor(union savefpu *); static int npx_attach(device_t dev); static void npx_identify(driver_t *driver, device_t parent); -static void npx_intr(void *); +static int npx_intr(void *); static int npx_probe(device_t dev); #ifdef I586_CPU_XXX static long timezero(const char *funcname, @@ -201,7 +201,7 @@ /* * Do minimal handling of npx interrupts to convert them to traps. */ -static void +static int npx_intr(dummy) void *dummy; { @@ -234,6 +234,7 @@ td->td_flags |= TDF_ASTPENDING; mtx_unlock_spin(&sched_lock); } + return (FILTER_HANDLED); } /* @@ -279,8 +280,8 @@ irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num, irq_num, 1, RF_ACTIVE); if (irq_res != NULL) { - if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC | INTR_FAST, - npx_intr, NULL, &irq_cookie) != 0) + if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC, + npx_intr, NULL, NULL, &irq_cookie) != 0) panic("npx: can't create intr"); }