diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-03-23 21:07:41 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-03-23 21:07:41 +0000 |
commit | f880be4594e702e459f1a64e16122a04a1548f62 (patch) | |
tree | 70a99d632099cd01c2d71fd4cbfe7953b2fcc287 /sys/arch/sgi/localbus | |
parent | f9bb69616f2bcaf3c499675e6dc7a5fc93d64939 (diff) |
Real atomic_{set,clear}bits_int implementation, and replace similar
{set,clr}_ipending with the above routines.
ok kettenis@
Diffstat (limited to 'sys/arch/sgi/localbus')
-rw-r--r-- | sys/arch/sgi/localbus/macebus.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/arch/sgi/localbus/macebus.c b/sys/arch/sgi/localbus/macebus.c index e6e56fd2d46..b072f25c2c7 100644 --- a/sys/arch/sgi/localbus/macebus.c +++ b/sys/arch/sgi/localbus/macebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macebus.c,v 1.18 2006/01/04 20:23:07 miod Exp $ */ +/* $OpenBSD: macebus.c,v 1.19 2007/03/23 21:07:40 miod Exp $ */ /* * Copyright (c) 2000-2004 Opsycon AB (www.opsycon.se) @@ -51,6 +51,7 @@ #include <machine/autoconf.h> #include <machine/intr.h> +#include <machine/atomic.h> #include <sgi/localbus/macebus.h> #include <sgi/localbus/crimebus.h> @@ -619,7 +620,7 @@ macebus_do_pending_int(int newcpl) /* Get what interrupt we should process */ hwpend = ipending & ~newcpl; hwpend &= ~SINT_ALLMASK; - clr_ipending(hwpend); + atomic_clearbits_int(&ipending, hwpend); /* Enable all non pending non masked hardware interrupts */ cpl = (cpl & SINT_ALLMASK) | (newcpl & ~SINT_ALLMASK) | hwpend; @@ -643,21 +644,21 @@ macebus_do_pending_int(int newcpl) hw_setintrmask(cpl); if ((ipending & SINT_CLOCKMASK) & ~newcpl) { - clr_ipending(SINT_CLOCKMASK); + atomic_clearbits_int(&ipending, SINT_CLOCKMASK); softclock(); } if ((ipending & SINT_NETMASK) & ~newcpl) { extern int netisr; int isr = netisr; netisr = 0; - clr_ipending(SINT_NETMASK); + atomic_clearbits_int(&ipending, SINT_NETMASK); #define DONETISR(b,f) if (isr & (1 << (b))) f(); #include <net/netisr_dispatch.h> } #ifdef NOTYET if ((ipending & SINT_TTYMASK) & ~newcpl) { - clr_ipending(SINT_TTYMASK); + atomic_clearbits_int(&ipending, SINT_TTYMASK); compoll(NULL); } #endif @@ -697,7 +698,7 @@ macebus_iointr(intrmask_t hwpend, struct trap_frame *cf) /* Mask off masked interrupts and save them as pending */ if (intstat & cf->cpl) { - set_ipending(intstat & cf->cpl); + atomic_setbits_int(&ipending, intstat & cf->cpl); mask = bus_space_read_8(&crimebus_tag, crime_h, CRIME_INT_MASK); mask &= ~ipending; bus_space_write_8(&crimebus_tag, crime_h, CRIME_INT_MASK, mask); @@ -706,7 +707,7 @@ macebus_iointr(intrmask_t hwpend, struct trap_frame *cf) /* Scan all unmasked. Scan the first 16 for now */ pending = intstat & ~cf->cpl; - clr_ipending(pending); + atomic_clearbits_int(&ipending, pending); for (v = 0, vm = 1; pending != 0 && v < 16 ; v++, vm <<= 1) { if (pending & vm) { |