From 342f1c8c6a5710f960fea7396ec57e8661e389f2 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 5 Apr 2007 17:33:51 +0000 Subject: Wrap bit operations between splhigh()/splx() for atomicity wrt interrupts. Not enough for multiprocessor, but we're not there yet anyway. --- sys/arch/vax/include/atomic.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sys') 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 + 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) */ -- cgit v1.2.3