diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-04-05 17:33:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-04-05 17:33:51 +0000 |
commit | 342f1c8c6a5710f960fea7396ec57e8661e389f2 (patch) | |
tree | 8d5239c27b1ef20aec17082bea2ff0bba845c77f /sys | |
parent | 6b436b5210f9b5c74ca41d79a068f2e6e0345e44 (diff) |
Wrap bit operations between splhigh()/splx() for atomicity wrt interrupts.
Not enough for multiprocessor, but we're not there yet anyway.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/vax/include/atomic.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/vax/include/atomic.h b/sys/arch/vax/include/atomic.h index 0e390863980..3cf2f7ebed0 100644 --- a/sys/arch/vax/include/atomic.h +++ b/sys/arch/vax/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ +/* $OpenBSD: atomic.h,v 1.3 2007/04/05 17:33:50 miod Exp $ */ /* Public Domain */ @@ -7,16 +7,26 @@ #if defined(_KERNEL) +#include <machine/mtpr.h> + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { + int s; + + s = splhigh(); *uip |= v; + splx(s); } static __inline void atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) { + int s; + + s = splhigh(); *uip &= ~v; + splx(s); } #endif /* defined(_KERNEL) */ |