--- p4_head/sys/amd64/amd64/intr_machdep.c Sun Jan 21 15:14:57 2007 +++ p4_head_intr/sys/amd64/amd64/intr_machdep.c Fri Jan 26 13:54:07 2007 @@ -158,8 +158,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; @@ -167,8 +167,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); @@ -266,7 +266,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; } @@ -274,9 +274,9 @@ 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); + ih->ih_filter(ih->ih_argument); } /* --- p4_head/sys/amd64/amd64/nexus.c Sun Jan 21 15:14:58 2007 +++ p4_head_intr/sys/amd64/amd64/nexus.c Fri Jan 26 13:54:07 2007 @@ -95,7 +95,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); @@ -415,7 +416,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; @@ -435,7 +437,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/amd64/include/intr_machdep.h Sun Jan 21 15:14:59 2007 +++ p4_head_intr/sys/amd64/include/intr_machdep.h Fri Jan 26 13:54:07 2007 @@ -135,8 +135,9 @@ #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/amd64/isa/clock.c Sun Jan 21 15:15:00 2007 +++ p4_head_intr/sys/amd64/isa/clock.c Fri Jan 26 13:54:07 2007 @@ -140,7 +140,7 @@ 0 /* quality */ }; -static void +static int clkintr(struct trapframe *frame) { @@ -157,6 +157,7 @@ } KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + return (FILTER_HANDLED); } int @@ -211,11 +212,13 @@ * 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) { + int flag = 0; while (rtcin(RTC_INTR) & RTCIR_PERIOD) { + flag = 1; if (profprocs != 0) { if (--pscnt == 0) pscnt = psdiv; @@ -224,6 +227,7 @@ if (pscnt == psdiv) statclock(TRAPF_USERMODE(frame)); } + return(flag ? FILTER_HANDLED : FILTER_STRAY); } #include "opt_ddb.h" @@ -761,8 +765,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 +799,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/amd64/isa/isa.c Sun Jan 21 15:15:01 2007 +++ p4_head_intr/sys/amd64/isa/isa.c Fri Jan 26 13:54:07 2007 @@ -147,10 +147,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