diff options
author | 2007-04-05 17:33:50 +0000 | |
---|---|---|
committer | 2007-04-05 17:33:50 +0000 | |
commit | 1b4bdea42ea4a04751c2638ed13c9c9309859c56 (patch) | |
tree | 244890b114b7595d7a66e39e940f0835d4bdcee3 /sys | |
parent | Reuse symbolic values for splsoftXXX() inlines, instead of hardcoding them. (diff) | |
download | wireguard-openbsd-1b4bdea42ea4a04751c2638ed13c9c9309859c56.tar.xz wireguard-openbsd-1b4bdea42ea4a04751c2638ed13c9c9309859c56.zip |
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) */ |