diff --git a/sys/arch/sparc64/dev/ebus.c b/sys/arch/sparc64/dev/ebus.c index 5f52fc309728..3e3ac9a9edc6 100644 --- a/sys/arch/sparc64/dev/ebus.c +++ b/sys/arch/sparc64/dev/ebus.c @@ -1,4 +1,4 @@ -/* $NetBSD: ebus.c,v 1.34 2002/10/02 16:02:18 thorpej Exp $ */ +/* $NetBSD: ebus.c,v 1.35 2002/12/10 12:24:05 pk Exp $ */ /* * Copyright (c) 1999, 2000, 2001 Matthew R. Green @@ -117,7 +117,7 @@ static paddr_t ebus_bus_mmap __P((bus_space_tag_t, bus_addr_t, off_t, int, int)) static int _ebus_bus_map __P((bus_space_tag_t, bus_addr_t, bus_size_t, int, vaddr_t, bus_space_handle_t *)); static void *ebus_intr_establish __P((bus_space_tag_t, int, int, int, - int (*) __P((void *)), void *)); + int (*) __P((void *)), void *, void(*)__P((void)))); int ebus_match(parent, match, aux) @@ -503,13 +503,14 @@ ebus_bus_mmap(t, paddr, off, prot, flags) * install an interrupt handler for a ebus device */ void * -ebus_intr_establish(t, pri, level, flags, handler, arg) +ebus_intr_establish(t, pri, level, flags, handler, arg, fastvec) bus_space_tag_t t; int pri; int level; int flags; int (*handler) __P((void *)); void *arg; + void (*fastvec) __P((void)); /* ignored */ { return (bus_intr_establish(t->parent, pri, level, flags, handler, arg)); diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c index 2c3037c82f88..a4fa1c2178af 100644 --- a/sys/arch/sparc64/dev/psycho.c +++ b/sys/arch/sparc64/dev/psycho.c @@ -1,4 +1,4 @@ -/* $NetBSD: psycho.c,v 1.55 2002/10/02 16:02:19 thorpej Exp $ */ +/* $NetBSD: psycho.c,v 1.56 2002/12/10 12:24:05 pk Exp $ */ /* * Copyright (c) 2001, 2002 Eduardo E. Horvath @@ -99,7 +99,7 @@ static paddr_t psycho_bus_mmap __P((bus_space_tag_t, bus_addr_t, off_t, static int _psycho_bus_map __P((bus_space_tag_t, bus_addr_t, bus_size_t, int, vaddr_t, bus_space_handle_t *)); static void *psycho_intr_establish __P((bus_space_tag_t, int, int, int, - int (*) __P((void *)), void *)); + int (*) __P((void *)), void *, void(*)__P((void)))); static int psycho_dmamap_load __P((bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t, struct proc *, int)); @@ -998,13 +998,14 @@ psycho_bus_mmap(t, paddr, off, prot, flags) * install an interrupt handler for a PCI device */ void * -psycho_intr_establish(t, ihandle, level, flags, handler, arg) +psycho_intr_establish(t, ihandle, level, flags, handler, arg, fastvec) bus_space_tag_t t; int ihandle; int level; int flags; int (*handler) __P((void *)); void *arg; + void (*fastvec) __P((void)); /* ignored */ { struct psycho_pbm *pp = t->cookie; struct psycho_softc *sc = pp->pp_sc; @@ -1042,48 +1043,46 @@ psycho_intr_establish(t, ihandle, level, flags, handler, arg) level = 2; } - if ((flags & BUS_INTR_ESTABLISH_SOFTINTR) == 0) { + DPRINTF(PDB_INTR, ("\npsycho: intr %lx: %p\nHunting for IRQ...\n", + (long)ino, intrlev[ino])); - DPRINTF(PDB_INTR, ("\npsycho: intr %lx: %p\nHunting for IRQ...\n", - (long)ino, intrlev[ino])); - - /* Hunt thru obio first */ - for (intrmapptr = &sc->sc_regs->scsi_int_map, - intrclrptr = &sc->sc_regs->scsi_clr_int; - intrmapptr < &sc->sc_regs->ffb0_int_map; - intrmapptr++, intrclrptr++) { - if (INTINO(*intrmapptr) == ino) - goto found; - } - - /* Now do PCI interrupts */ - for (intrmapptr = &sc->sc_regs->pcia_slot0_int, - intrclrptr = &sc->sc_regs->pcia0_clr_int[0]; - intrmapptr <= &sc->sc_regs->pcib_slot3_int; - intrmapptr++, intrclrptr += 4) { - if (((*intrmapptr ^ vec) & 0x3c) == 0) { - intrclrptr += vec & 0x3; - goto found; - } - } - - /* Finally check the two FFB slots */ - intrclrptr = NULL; /* XXX? */ - for (intrmapptr = &sc->sc_regs->ffb0_int_map; - intrmapptr <= &sc->sc_regs->ffb1_int_map; - intrmapptr++) { - if (INTVEC(*intrmapptr) == ino) - goto found; - } - - printf("Cannot find interrupt vector %lx\n", vec); - return (NULL); - - found: - /* Register the map and clear intr registers */ - ih->ih_map = intrmapptr; - ih->ih_clr = intrclrptr; + /* Hunt thru obio first */ + for (intrmapptr = &sc->sc_regs->scsi_int_map, + intrclrptr = &sc->sc_regs->scsi_clr_int; + intrmapptr < &sc->sc_regs->ffb0_int_map; + intrmapptr++, intrclrptr++) { + if (INTINO(*intrmapptr) == ino) + goto found; } + + /* Now do PCI interrupts */ + for (intrmapptr = &sc->sc_regs->pcia_slot0_int, + intrclrptr = &sc->sc_regs->pcia0_clr_int[0]; + intrmapptr <= &sc->sc_regs->pcib_slot3_int; + intrmapptr++, intrclrptr += 4) { + if (((*intrmapptr ^ vec) & 0x3c) == 0) { + intrclrptr += vec & 0x3; + goto found; + } + } + + /* Finally check the two FFB slots */ + intrclrptr = NULL; /* XXX? */ + for (intrmapptr = &sc->sc_regs->ffb0_int_map; + intrmapptr <= &sc->sc_regs->ffb1_int_map; + intrmapptr++) { + if (INTVEC(*intrmapptr) == ino) + goto found; + } + + printf("Cannot find interrupt vector %lx\n", vec); + return (NULL); + +found: + /* Register the map and clear intr registers */ + ih->ih_map = intrmapptr; + ih->ih_clr = intrclrptr; + #ifdef NOT_DEBUG if (psycho_debug & PDB_INTR) { long i; diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c index c2f9943fe875..0b6ec447067c 100644 --- a/sys/arch/sparc64/dev/sbus.c +++ b/sys/arch/sparc64/dev/sbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbus.c,v 1.55 2002/10/02 16:02:19 thorpej Exp $ */ +/* $NetBSD: sbus.c,v 1.56 2002/12/10 12:24:05 pk Exp $ */ /* * Copyright (c) 1999-2002 Eduardo Horvath @@ -85,7 +85,8 @@ static void *sbus_intr_establish __P(( int, /*`device class' priority*/ int, /*flags*/ int (*) __P((void *)), /*handler*/ - void *)); /*handler arg*/ + void *, /*handler arg*/ + void (*) __P((void)))); /*optional fast trap*/ /* autoconfiguration driver */ @@ -603,13 +604,14 @@ sbus_get_intr(sc, node, ipp, np, slot) * Install an interrupt handler for an Sbus device. */ void * -sbus_intr_establish(t, pri, level, flags, handler, arg) +sbus_intr_establish(t, pri, level, flags, handler, arg, fastvec) bus_space_tag_t t; int pri; int level; int flags; int (*handler) __P((void *)); void *arg; + void (*fastvec) __P((void)); /* ignored */ { struct sbus_softc *sc = t->cookie; struct intrhand *ih; @@ -621,9 +623,7 @@ sbus_intr_establish(t, pri, level, flags, handler, arg) if (ih == NULL) return (NULL); - if ((flags & BUS_INTR_ESTABLISH_SOFTINTR) != 0) - ipl = vec; - else if ((vec & SBUS_INTR_COMPAT) != 0) + if ((vec & SBUS_INTR_COMPAT) != 0) ipl = vec & ~SBUS_INTR_COMPAT; else { /* Decode and remove IPL */ diff --git a/sys/arch/sparc64/include/bus.h b/sys/arch/sparc64/include/bus.h index 6a1d02b9b016..6ab4ebb330c3 100644 --- a/sys/arch/sparc64/include/bus.h +++ b/sys/arch/sparc64/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.39 2002/03/21 00:43:42 eeh Exp $ */ +/* $NetBSD: bus.h,v 1.40 2002/12/10 12:24:06 pk Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -162,7 +162,7 @@ struct sparc_bus_space_tag { int, int)); void *(*sparc_intr_establish) __P((bus_space_tag_t, int, int, int, - int (*) __P((void *)), void *)); + int (*) __P((void *)), void *, void (*)__P((void)))); }; @@ -319,7 +319,7 @@ bus_intr_establish(t, p, l, f, h, a) int (*h)__P((void *)); void *a; { - _BS_CALL(t, sparc_intr_establish)(t, p, l, f, h, a); + _BS_CALL(t, sparc_intr_establish)(t, p, l, f, h, a, NULL); } /* XXXX Things get complicated if we use unmapped register accesses. */ @@ -337,10 +337,6 @@ bus_intr_establish(t, p, l, f, h, a) #define BUS_SPACE_MAP_BUS4 0x0800 -/* flags for intr_establish() */ -#define BUS_INTR_ESTABLISH_FASTTRAP 1 -#define BUS_INTR_ESTABLISH_SOFTINTR 2 - /* flags for bus_space_barrier() */ #define BUS_SPACE_BARRIER_READ 0x01 /* force read barrier */ #define BUS_SPACE_BARRIER_WRITE 0x02 /* force write barrier */ diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 0cdcc4e35987..8955b6713c6e 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.134 2002/11/27 18:00:27 pk Exp $ */ +/* $NetBSD: machdep.c,v 1.135 2002/12/10 12:24:07 pk Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -1806,7 +1806,7 @@ static int sparc_bus_subregion __P((bus_space_tag_t, bus_space_handle_t, static paddr_t sparc_bus_mmap __P((bus_space_tag_t, bus_addr_t, off_t, int, int)); static void *sparc_mainbus_intr_establish __P((bus_space_tag_t, int, int, int, int (*) __P((void *)), - void *)); + void *, void (*)__P((void)))); static int sparc_bus_alloc __P((bus_space_tag_t, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *)); @@ -1973,13 +1973,14 @@ sparc_bus_mmap(t, paddr, off, prot, flags) void * -sparc_mainbus_intr_establish(t, pil, level, flags, handler, arg) +sparc_mainbus_intr_establish(t, pil, level, flags, handler, arg, fastvec) bus_space_tag_t t; int pil; int level; int flags; int (*handler)__P((void *)); void *arg; + void (*fastvec)__P((void)); /* ignored */ { struct intrhand *ih;