diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-22 20:05:29 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-22 20:05:29 +0000 |
commit | a81feba34f8a90600807b2131fe19f958f163e15 (patch) | |
tree | 14ab513274bfa4aa22baace7bcc271755854f2d2 /sys/arch | |
parent | 5c891a01c345a36982404a82bee072e829efce60 (diff) |
Replace intrmask_t with uint32_t. This types only describes interrupt masks
in the coprocessor 0 status register (coupled with ICR on rm7k/rm9k), and
may be completely alien to real hardware interrupt masks, so don't make
things unnecessary confusing.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mips64/include/cpu.h | 8 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/clock.c | 8 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/interrupt.c | 18 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/softintr.c | 4 | ||||
-rw-r--r-- | sys/arch/sgi/include/intr.h | 21 | ||||
-rw-r--r-- | sys/arch/sgi/localbus/macebus.c | 30 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip27_machdep.c | 14 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip30_machdep.c | 4 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xheart.c | 12 |
9 files changed, 57 insertions, 62 deletions
diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index 119c34483f7..119b428aa1d 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.38 2009/10/07 08:35:47 syuu Exp $ */ +/* $OpenBSD: cpu.h,v 1.39 2009/10/22 20:05:26 miod Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -373,9 +373,9 @@ struct cpu_info { ci_schedstate; int ci_want_resched; /* need_resched() invoked */ cpuid_t ci_cpuid; /* our CPU ID */ - u_int32_t ci_randseed; /* per cpu random seed */ - intrmask_t ci_cpl; - intrmask_t ci_ipending; + uint32_t ci_randseed; /* per cpu random seed */ + uint32_t ci_cpl; + uint32_t ci_ipending; #ifdef MULTIPROCESSOR u_long ci_flags; /* flags; see below */ #endif diff --git a/sys/arch/mips64/mips64/clock.c b/sys/arch/mips64/mips64/clock.c index 140fb14efd8..1db4204d7e6 100644 --- a/sys/arch/mips64/mips64/clock.c +++ b/sys/arch/mips64/mips64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.23 2009/05/06 20:02:45 miod Exp $ */ +/* $OpenBSD: clock.c,v 1.24 2009/10/22 20:05:27 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -52,7 +52,7 @@ struct cfattach clock_ca = { sizeof(struct device), clockmatch, clockattach }; -intrmask_t clock_int5(intrmask_t, struct trap_frame *); +uint32_t clock_int5(uint32_t, struct trap_frame *); int clock_started; u_int32_t cpu_counter_last; @@ -119,8 +119,8 @@ clockattach(struct device *parent, struct device *self, void *aux) * can not be run the tick is just counted and handled later when * the clock is unmasked again. */ -intrmask_t -clock_int5(intrmask_t mask, struct trap_frame *tf) +uint32_t +clock_int5(uint32_t mask, struct trap_frame *tf) { u_int32_t clkdiff; diff --git a/sys/arch/mips64/mips64/interrupt.c b/sys/arch/mips64/mips64/interrupt.c index 73cd2752d57..2326f3c29fa 100644 --- a/sys/arch/mips64/mips64/interrupt.c +++ b/sys/arch/mips64/mips64/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.44 2009/10/22 18:46:48 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.45 2009/10/22 20:05:27 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -58,14 +58,14 @@ static struct evcount soft_count; static int soft_irq = 0; -intrmask_t imask[NIPLS]; +uint32_t imask[NIPLS]; -intrmask_t idle_mask; +uint32_t idle_mask; int last_low_int; struct { - intrmask_t int_mask; - intrmask_t (*int_hand)(intrmask_t, struct trap_frame *); + uint32_t int_mask; + uint32_t (*int_hand)(uint32_t, struct trap_frame *); } cpu_int_tab[NLOWINT]; void dummy_do_pending_int(int); @@ -135,7 +135,7 @@ interrupt(struct trap_frame *trapframe) u_int32_t pending; u_int32_t cause; int i; - intrmask_t xcpl; + uint32_t xcpl; /* * Paranoic? Perhaps. But if we got here with the enable @@ -171,7 +171,7 @@ interrupt(struct trap_frame *trapframe) #endif for (i = 0; i <= last_low_int; i++) { - intrmask_t active; + uint32_t active; active = cpu_int_tab[i].int_mask & pending; if (active) { cause &= ~(*cpu_int_tab[i].int_hand)(active, trapframe); @@ -204,8 +204,8 @@ interrupt(struct trap_frame *trapframe) * software ints here since they are always on. */ void -set_intr(int pri, intrmask_t mask, - intrmask_t (*int_hand)(intrmask_t, struct trap_frame *)) +set_intr(int pri, uint32_t mask, + uint32_t (*int_hand)(uint32_t, struct trap_frame *)) { if ((idle_mask & SOFT_INT_MASK) == 0) evcount_attach(&soft_count, "soft", (void *)&soft_irq, &evcount_intr); diff --git a/sys/arch/mips64/mips64/softintr.c b/sys/arch/mips64/mips64/softintr.c index 62c6f220780..764df17a3ed 100644 --- a/sys/arch/mips64/mips64/softintr.c +++ b/sys/arch/mips64/mips64/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.2 2009/10/07 08:35:47 syuu Exp $ */ +/* $OpenBSD: softintr.c,v 1.3 2009/10/22 20:05:27 miod Exp $ */ /* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */ /* @@ -200,7 +200,7 @@ netintr(void) } void -dosoftint(intrmask_t xcpl) +dosoftint(uint32_t xcpl) { struct cpu_info *ci = curcpu(); int sir, q, mask; diff --git a/sys/arch/sgi/include/intr.h b/sys/arch/sgi/include/intr.h index f25277d7800..a9b1fe3a85b 100644 --- a/sys/arch/sgi/include/intr.h +++ b/sys/arch/sgi/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.30 2009/10/21 20:48:45 miod Exp $ */ +/* $OpenBSD: intr.h,v 1.31 2009/10/22 20:05:28 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -151,14 +151,9 @@ void splinit(void); #define INTPRI_XBOWMUX 2 /* Origin 200/2000 I/O interrupt */ #define INTPRI_MACEAUX 3 -/* - * Define a type for interrupt masks. We may need 64 bits here. - */ -typedef u_int32_t intrmask_t; /* Type of var holding interrupt mask */ - -#define INTMASKSIZE (sizeof(intrmask_t) * 8) +#define INTMASKSIZE 32 -extern intrmask_t imask[NIPLS]; +extern uint32_t imask[NIPLS]; /* * A note on clock interrupts. Clock interrupts are always @@ -210,17 +205,17 @@ extern struct intrhand *intrhand[INTMASKSIZE]; struct trap_frame; -extern intrmask_t idle_mask; +extern uint32_t idle_mask; extern int last_low_int; -void set_intr(int, intrmask_t, intrmask_t(*)(intrmask_t, struct trap_frame *)); +void set_intr(int, uint32_t, uint32_t(*)(uint32_t, struct trap_frame *)); #ifdef IMASK_EXTERNAL -void hw_setintrmask(intrmask_t); +void hw_setintrmask(uint32_t); #endif -u_int32_t updateimask(intrmask_t); -void dosoftint(intrmask_t); +u_int32_t updateimask(uint32_t); +void dosoftint(uint32_t); #endif /* _LOCORE */ diff --git a/sys/arch/sgi/localbus/macebus.c b/sys/arch/sgi/localbus/macebus.c index a293d046dc9..f4c9f3488e9 100644 --- a/sys/arch/sgi/localbus/macebus.c +++ b/sys/arch/sgi/localbus/macebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macebus.c,v 1.45 2009/10/21 20:48:45 miod Exp $ */ +/* $OpenBSD: macebus.c,v 1.46 2009/10/22 20:05:28 miod Exp $ */ /* * Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se) @@ -55,8 +55,8 @@ int macebussearch(struct device *, void *, void *); void macebus_intr_makemasks(void); void macebus_do_pending_int(int); -intrmask_t macebus_iointr(intrmask_t, struct trap_frame *); -intrmask_t macebus_aux(intrmask_t, struct trap_frame *); +uint32_t macebus_iointr(uint32_t, struct trap_frame *); +uint32_t macebus_aux(uint32_t, struct trap_frame *); u_int8_t mace_read_1(bus_space_tag_t, bus_space_handle_t, bus_size_t); u_int16_t mace_read_2(bus_space_tag_t, bus_space_handle_t, bus_size_t); @@ -430,10 +430,10 @@ macebus_device_to_pa(bus_addr_t addr) * Macebus interrupt handler driver. */ -intrmask_t mace_intem = 0x0; -static intrmask_t intrtype[INTMASKSIZE]; -static intrmask_t intrmask[INTMASKSIZE]; -static intrmask_t intrlevel[INTMASKSIZE]; +uint64_t mace_intem = 0x0; +static uint32_t intrtype[INTMASKSIZE]; +static uint32_t intrmask[INTMASKSIZE]; +static uint32_t intrlevel[INTMASKSIZE]; static int fakeintr(void *); static int fakeintr(void *a) {return 0;} @@ -610,13 +610,13 @@ macebus_do_pending_int(int newcpl) /* * Process interrupts. The parameter pending has non-masked interrupts. */ -intrmask_t -macebus_iointr(intrmask_t hwpend, struct trap_frame *cf) +uint32_t +macebus_iointr(uint32_t hwpend, struct trap_frame *cf) { struct intrhand *ih; - intrmask_t caught, vm; + uint32_t caught, vm; int v; - intrmask_t pending; + uint32_t pending; u_int64_t intstat, isastat, mask; #ifdef DIAGNOSTIC static int spurious = 0; @@ -701,8 +701,8 @@ macebus_iointr(intrmask_t hwpend, struct trap_frame *cf) /* * Macebus auxilary functions run each clock interrupt. */ -intrmask_t -macebus_aux(intrmask_t hwpend, struct trap_frame *cf) +uint32_t +macebus_aux(uint32_t hwpend, struct trap_frame *cf) { u_int64_t mask; @@ -726,8 +726,8 @@ macebus_aux(intrmask_t hwpend, struct trap_frame *cf) } void -hw_setintrmask(intrmask_t m) +hw_setintrmask(uint32_t m) { *(volatile uint64_t *)(PHYS_TO_XKPHYS(CRIMEBUS_BASE, CCA_NC) + - CRIME_INT_MASK) = mace_intem & ~m; + CRIME_INT_MASK) = mace_intem & ~((uint64_t)m); } diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c index 2f4f21bcf5a..85d18039ded 100644 --- a/sys/arch/sgi/sgi/ip27_machdep.c +++ b/sys/arch/sgi/sgi/ip27_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip27_machdep.c,v 1.24 2009/10/22 18:35:28 miod Exp $ */ +/* $OpenBSD: ip27_machdep.c,v 1.25 2009/10/22 20:05:28 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -70,7 +70,7 @@ int ip27_hub_intr_register(int, int, int *); int ip27_hub_intr_establish(int (*)(void *), void *, int, int, const char *); void ip27_hub_intr_disestablish(int); -intrmask_t ip27_hub_intr_handler(intrmask_t, struct trap_frame *); +uint32_t ip27_hub_intr_handler(uint32_t, struct trap_frame *); void ip27_hub_intr_makemasks(void); void ip27_hub_do_pending_int(int); @@ -674,7 +674,7 @@ ip27_hub_intr_makemasks() { int irq, level; struct intrhand *q; - intrmask_t intrlevel[INTMASKSIZE]; + uint32_t intrlevel[INTMASKSIZE]; /* First, figure out which levels each IRQ uses. */ for (irq = 0; irq < INTMASKSIZE; irq++) { @@ -733,13 +733,13 @@ ip27_hub_do_pending_int(int newcpl) setsoftintr0(); } -intrmask_t -ip27_hub_intr_handler(intrmask_t hwpend, struct trap_frame *frame) +uint32_t +ip27_hub_intr_handler(uint32_t hwpend, struct trap_frame *frame) { uint64_t imr, isr; int icpl; int bit; - intrmask_t mask; + uint32_t mask; struct intrhand *ih; int rc; struct cpu_info *ci = curcpu(); @@ -814,7 +814,7 @@ ip27_hub_intr_handler(intrmask_t hwpend, struct trap_frame *frame) } void -hw_setintrmask(intrmask_t m) +hw_setintrmask(uint32_t m) { IP27_LHUB_S(HUBPI_CPU0_IMR0, ip27_hub_intrmask & ~((uint64_t)m)); (void)IP27_LHUB_L(HUBPI_IR0); diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c index 81effc84571..e8ad964a40f 100644 --- a/sys/arch/sgi/sgi/ip30_machdep.c +++ b/sys/arch/sgi/sgi/ip30_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip30_machdep.c,v 1.11 2009/10/16 00:15:49 miod Exp $ */ +/* $OpenBSD: ip30_machdep.c,v 1.12 2009/10/22 20:05:28 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -200,7 +200,7 @@ ip30_widget_id(int16_t nasid, u_int widget, uint32_t *wid) } void -hw_setintrmask(intrmask_t m) +hw_setintrmask(uint32_t m) { extern uint64_t heart_intem; diff --git a/sys/arch/sgi/xbow/xheart.c b/sys/arch/sgi/xbow/xheart.c index 9fddeb28526..1a9a8e077ee 100644 --- a/sys/arch/sgi/xbow/xheart.c +++ b/sys/arch/sgi/xbow/xheart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xheart.c,v 1.9 2009/10/07 08:35:47 syuu Exp $ */ +/* $OpenBSD: xheart.c,v 1.10 2009/10/22 20:05:28 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -68,7 +68,7 @@ int xheart_ow_pulse(struct xheart_softc *, int, int); int xheart_intr_register(int, int, int *); int xheart_intr_establish(int (*)(void *), void *, int, int, const char *); void xheart_intr_disestablish(int); -intrmask_t xheart_intr_handler(intrmask_t, struct trap_frame *); +uint32_t xheart_intr_handler(uint32_t, struct trap_frame *); void xheart_intr_makemasks(struct xheart_softc *); void xheart_do_pending_int(int); @@ -345,7 +345,7 @@ xheart_intr_makemasks(struct xheart_softc *sc) { int irq, level; struct intrhand *q; - intrmask_t intrlevel[INTMASKSIZE]; + uint32_t intrlevel[INTMASKSIZE]; /* First, figure out which levels each IRQ uses. */ for (irq = 0; irq < INTMASKSIZE; irq++) { @@ -405,15 +405,15 @@ xheart_do_pending_int(int newcpl) setsoftintr0(); } -intrmask_t -xheart_intr_handler(intrmask_t hwpend, struct trap_frame *frame) +uint32_t +xheart_intr_handler(uint32_t hwpend, struct trap_frame *frame) { struct cpu_info *ci = curcpu(); paddr_t heart; uint64_t imr, isr; int icpl; int bit; - intrmask_t mask; + uint32_t mask; struct intrhand *ih; int rc; |