diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index 75f59c87b956..4bce4cdb2c6e 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -327,7 +327,7 @@ LIST_HEAD(alpha_intr_list, alpha_intr); struct alpha_intr { LIST_ENTRY(alpha_intr) list; /* chain handlers in this hash bucket */ - int vector; /* vector to match */ + uintptr_t vector; /* vector to match */ struct ithd *ithd; /* interrupt thread */ volatile long *cntp; /* interrupt counter */ }; @@ -346,9 +346,9 @@ ithds_init(void *dummy) SYSINIT(ithds_init, SI_SUB_INTR, SI_ORDER_SECOND, ithds_init, NULL); int -alpha_setup_intr(const char *name, int vector, driver_intr_t handler, void *arg, +alpha_setup_intr(const char *name, uintptr_t vector, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep, volatile long *cntp, - void (*disable)(int), void (*enable)(int)) + void (*disable)(uintptr_t), void (*enable)(uintptr_t)) { int h = HASHVEC(vector); struct alpha_intr *i; diff --git a/sys/alpha/include/intr.h b/sys/alpha/include/intr.h index ea71e3fc9784..90a0bbf9f39d 100644 --- a/sys/alpha/include/intr.h +++ b/sys/alpha/include/intr.h @@ -31,9 +31,10 @@ extern struct mtx icu_lock; -int alpha_setup_intr(const char *name, int vector, driver_intr_t handler, - void *arg, enum intr_type flags, void **cookiep, - volatile long *cntp, void (*disable)(int), void (*enable)(int)); +int alpha_setup_intr(const char *name, uintptr_t vector, + driver_intr_t handler, void *arg, enum intr_type flags, + void **cookiep, volatile long *cntp, + void (*disable)(uintptr_t), void (*enable)(uintptr_t)); int alpha_teardown_intr(void *cookie); void alpha_dispatch_intr(void *frame, unsigned long vector); diff --git a/sys/alpha/isa/isa.c b/sys/alpha/isa/isa.c index aa372641b613..f2054e7a14e9 100644 --- a/sys/alpha/isa/isa.c +++ b/sys/alpha/isa/isa.c @@ -310,10 +310,11 @@ isa_handle_intr(void *arg) */ static void -isa_disable_intr(int vector) +isa_disable_intr(uintptr_t vector) { - int irq = (vector - 0x800) >> 4; + int irq; + irq = (vector - 0x800) >> 4; mtx_lock_spin(&icu_lock); if (irq > 7) outb(IO_ICU2, 0x20 | (irq & 7)); @@ -324,7 +325,7 @@ isa_disable_intr(int vector) } static void -isa_enable_intr(int vector) +isa_enable_intr(uintptr_t vector) { int irq; diff --git a/sys/alpha/mcbus/mcpcia.c b/sys/alpha/mcbus/mcpcia.c index 442a47bb9027..c1010e4e7d32 100644 --- a/sys/alpha/mcbus/mcpcia.c +++ b/sys/alpha/mcbus/mcpcia.c @@ -304,13 +304,13 @@ mcpcia_disable_intr(struct mcpcia_softc *sc, int irq) } static void -mcpcia_disable_intr_vec(int vector) +mcpcia_disable_intr_vec(uintptr_t vector) { int mid, irq; struct mcpcia_softc *sc = mcpcia_root; if (vector < MCPCIA_VEC_PCI) { - printf("EISA disable (0x%x)\n", vector); + printf("EISA disable (0x%lx)\n", vector); return; } @@ -324,7 +324,7 @@ mcpcia_disable_intr_vec(int vector) tmp &= (MCPCIA_VECWIDTH_PER_MCPCIA - 1); slot = tmp / MCPCIA_VECWIDTH_PER_SLOT; if (slot < 2 || slot > 5) { - printf("Bad slot (%d) for vector %x\n", slot, vector); + printf("Bad slot (%d) for vector %lx\n", slot, vector); return; } tmp -= (2 * MCPCIA_VECWIDTH_PER_SLOT); @@ -338,7 +338,7 @@ mcpcia_disable_intr_vec(int vector) sc = sc->next; } if (sc == NULL) { - panic("couldn't find MCPCIA softc for vector 0x%x", vector); + panic("couldn't find MCPCIA softc for vector 0x%lx", vector); } mtx_lock_spin(&icu_lock); mcpcia_disable_intr(sc, irq); @@ -346,13 +346,13 @@ mcpcia_disable_intr_vec(int vector) } static void -mcpcia_enable_intr_vec(int vector) +mcpcia_enable_intr_vec(uintptr_t vector) { int mid, irq; struct mcpcia_softc *sc = mcpcia_root; if (vector < MCPCIA_VEC_PCI) { - printf("EISA ensable (0x%x)\n", vector); + printf("EISA ensable (0x%lx)\n", vector); return; } @@ -366,7 +366,7 @@ mcpcia_enable_intr_vec(int vector) tmp &= (MCPCIA_VECWIDTH_PER_MCPCIA - 1); slot = tmp / MCPCIA_VECWIDTH_PER_SLOT; if (slot < 2 || slot > 5) { - printf("Bad slot (%d) for vector %x\n", slot, vector); + printf("Bad slot (%d) for vector %lx\n", slot, vector); return; } tmp -= (2 * MCPCIA_VECWIDTH_PER_SLOT); @@ -380,7 +380,7 @@ mcpcia_enable_intr_vec(int vector) sc = sc->next; } if (sc == NULL) { - panic("couldn't find MCPCIA softc for vector 0x%x", vector); + panic("couldn't find MCPCIA softc for vector 0x%lx", vector); } mtx_lock_spin(&icu_lock); mcpcia_enable_intr(sc, irq); diff --git a/sys/alpha/pci/apecs.c b/sys/alpha/pci/apecs.c index a94ac84cde14..cd9da0427643 100644 --- a/sys/alpha/pci/apecs.c +++ b/sys/alpha/pci/apecs.c @@ -308,7 +308,7 @@ apecs_attach(device_t dev) } static void -apecs_disable_intr(int vector) +apecs_disable_intr(uintptr_t vector) { int irq; @@ -319,7 +319,7 @@ apecs_disable_intr(int vector) } static void -apecs_enable_intr(int vector) +apecs_enable_intr(uintptr_t vector) { int irq; diff --git a/sys/alpha/pci/cia.c b/sys/alpha/pci/cia.c index 962ac65b74c6..6e6c7fec9d4b 100644 --- a/sys/alpha/pci/cia.c +++ b/sys/alpha/pci/cia.c @@ -515,7 +515,7 @@ cia_attach(device_t dev) } static void -cia_disable_intr(int vector) +cia_disable_intr(uintptr_t vector) { int irq; @@ -526,7 +526,7 @@ cia_disable_intr(int vector) } static void -cia_enable_intr(int vector) +cia_enable_intr(uintptr_t vector) { int irq; diff --git a/sys/alpha/pci/t2.c b/sys/alpha/pci/t2.c index 72cf4b2e9bfd..bc561f210f3c 100644 --- a/sys/alpha/pci/t2.c +++ b/sys/alpha/pci/t2.c @@ -457,7 +457,7 @@ t2_eoi( int vector) } static void -t2_enable_vec(int vector) +t2_enable_vec(uintptr_t vector) { int irq, hose; u_long IC_mask, scratch; @@ -491,7 +491,7 @@ t2_enable_vec(int vector) } static void -t2_disable_vec(int vector) +t2_disable_vec(uintptr_t vector) { int hose, irq; u_long scratch, IC_mask; diff --git a/sys/alpha/pci/tsunami.c b/sys/alpha/pci/tsunami.c index 12db80e87a86..9efc44cbc284 100644 --- a/sys/alpha/pci/tsunami.c +++ b/sys/alpha/pci/tsunami.c @@ -308,7 +308,7 @@ tsunami_attach(device_t dev) } static void -tsunami_disable_intr_vec(int vector) +tsunami_disable_intr_vec(uintptr_t vector) { int irq; @@ -319,7 +319,7 @@ tsunami_disable_intr_vec(int vector) } static void -tsunami_enable_intr_vec(int vector) +tsunami_enable_intr_vec(uintptr_t vector) { int irq; diff --git a/sys/amd64/amd64/intr_machdep.c b/sys/amd64/amd64/intr_machdep.c index 3f5aa37b29e9..d023a866f6cf 100644 --- a/sys/amd64/amd64/intr_machdep.c +++ b/sys/amd64/amd64/intr_machdep.c @@ -57,7 +57,7 @@ #define MAX_STRAY_LOG 5 -typedef void (*mask_fn)(int vector); +typedef void (*mask_fn)(uintptr_t vector); static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; @@ -81,19 +81,7 @@ intr_register_source(struct intsrc *isrc) vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); - /* - * Ok, so this is kind of a nasty optimization that only works - * because sizeof(int) == sizeof(void *) on i386. If we passed - * in the actual vector to ithread_create and then used wrapper - * functions for disable_intsrc and enable_intsrc, then we'd - * have to go lookup in the table everytime we enabled/disabled - * the interrupt source. That involves looking at a lock, etc. - * and is just ugly. Instead, we cast the pointer to the intsrc - * to an int (yuck) and pass in the actual PIC methods meaning - * that when we enable/disable an interrupt we call the PIC - * methods directly. - */ - error = ithread_create(&isrc->is_ithread, (intptr_t)isrc, 0, + error = ithread_create(&isrc->is_ithread, (uintptr_t)isrc, 0, (mask_fn)isrc->is_pic->pic_disable_source, (mask_fn)isrc->is_pic->pic_enable_source, "irq%d:", vector); if (error) diff --git a/sys/i386/i386/intr_machdep.c b/sys/i386/i386/intr_machdep.c index 3f5aa37b29e9..d023a866f6cf 100644 --- a/sys/i386/i386/intr_machdep.c +++ b/sys/i386/i386/intr_machdep.c @@ -57,7 +57,7 @@ #define MAX_STRAY_LOG 5 -typedef void (*mask_fn)(int vector); +typedef void (*mask_fn)(uintptr_t vector); static int intrcnt_index; static struct intsrc *interrupt_sources[NUM_IO_INTS]; @@ -81,19 +81,7 @@ intr_register_source(struct intsrc *isrc) vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); - /* - * Ok, so this is kind of a nasty optimization that only works - * because sizeof(int) == sizeof(void *) on i386. If we passed - * in the actual vector to ithread_create and then used wrapper - * functions for disable_intsrc and enable_intsrc, then we'd - * have to go lookup in the table everytime we enabled/disabled - * the interrupt source. That involves looking at a lock, etc. - * and is just ugly. Instead, we cast the pointer to the intsrc - * to an int (yuck) and pass in the actual PIC methods meaning - * that when we enable/disable an interrupt we call the PIC - * methods directly. - */ - error = ithread_create(&isrc->is_ithread, (intptr_t)isrc, 0, + error = ithread_create(&isrc->is_ithread, (uintptr_t)isrc, 0, (mask_fn)isrc->is_pic->pic_disable_source, (mask_fn)isrc->is_pic->pic_enable_source, "irq%d:", vector); if (error) diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index 5c71c01ee71c..0401a9a667d9 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -263,7 +263,7 @@ ithds_init(void *dummy) SYSINIT(ithds_init, SI_SUB_INTR, SI_ORDER_SECOND, ithds_init, NULL); static void -ia64_send_eoi(int vector) +ia64_send_eoi(uintptr_t vector) { int irq, i; diff --git a/sys/powerpc/include/intr_machdep.h b/sys/powerpc/include/intr_machdep.h index 2d07a8b13d01..d2d548e9e95e 100644 --- a/sys/powerpc/include/intr_machdep.h +++ b/sys/powerpc/include/intr_machdep.h @@ -40,7 +40,7 @@ struct intr_handler { u_int ih_flags; }; -void intr_init(void (*)(void), int, void (*)(int), void (*)(int)); +void intr_init(void (*)(void), int, void (*)(uintptr_t), void (*)(uintptr_t)); void intr_setup(u_int, ih_func_t *, void *, u_int); int inthand_add(const char *, u_int, void (*)(void *), void *, int, void **); diff --git a/sys/powerpc/powermac/hrowpic.c b/sys/powerpc/powermac/hrowpic.c index 5aeef93d4686..ed4b9c2451c7 100644 --- a/sys/powerpc/powermac/hrowpic.c +++ b/sys/powerpc/powermac/hrowpic.c @@ -94,8 +94,8 @@ static int hrowpic_macio_attach(device_t); * Local routines */ static void hrowpic_intr(void); -static void hrowpic_ext_enable_irq(int); -static void hrowpic_ext_disable_irq(int); +static void hrowpic_ext_enable_irq(uintptr_t); +static void hrowpic_ext_disable_irq(uintptr_t); static void hrowpic_toggle_irq(struct hrowpic_softc *sc, int, int); /* @@ -375,13 +375,13 @@ hrowpic_intr(void) } static void -hrowpic_ext_enable_irq(int irq) +hrowpic_ext_enable_irq(uintptr_t irq) { hrowpic_toggle_irq(hpicsoftc, irq, 1); } static void -hrowpic_ext_disable_irq(int irq) +hrowpic_ext_disable_irq(uintptr_t irq) { hrowpic_toggle_irq(hpicsoftc, irq, 0); } diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index 8682714aab1c..4f0684d95367 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -99,12 +99,12 @@ extern u_long extint_call; static ih_func_t intr_stray_handler; static ih_func_t sched_ithd; -static void (*irq_enable)(int); -static void (*irq_disable)(int); +static void (*irq_enable)(uintptr_t); +static void (*irq_disable)(uintptr_t); void -intr_init(void (*handler)(void), int nirq, void (*irq_e)(int), - void (*irq_d)(int)) +intr_init(void (*handler)(void), int nirq, void (*irq_e)(uintptr_t), + void (*irq_d)(uintptr_t)) { int i; u_int32_t msr; diff --git a/sys/powerpc/powerpc/openpic.c b/sys/powerpc/powerpc/openpic.c index 27a8cb86c3c6..864fae4b57f0 100644 --- a/sys/powerpc/powerpc/openpic.c +++ b/sys/powerpc/powerpc/openpic.c @@ -85,8 +85,8 @@ static void openpic_enable_irq(struct openpic_softc *, int, int); static void openpic_disable_irq(struct openpic_softc *, int); static void openpic_set_priority(struct openpic_softc *, int, int); static void openpic_intr(void); -static void irq_enable(int); -static void irq_disable(int); +static void irq_enable(uintptr_t); +static void irq_disable(uintptr_t); /* * Driver methods. @@ -476,14 +476,14 @@ start: } static void -irq_enable(int irq) +irq_enable(uintptr_t irq) { openpic_enable_irq(softc, irq, IST_LEVEL); } static void -irq_disable(int irq) +irq_disable(uintptr_t irq) { openpic_disable_irq(softc, irq);