summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/include/atomic.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/arch/sparc/include/atomic.h b/sys/arch/sparc/include/atomic.h
index 72beef1ec48..0788777e6a3 100644
--- a/sys/arch/sparc/include/atomic.h
+++ b/sys/arch/sparc/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/27 19:22:47 miod Exp $ */
/* Public Domain */
@@ -10,13 +10,23 @@
static __inline void
atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
{
+ int psr;
+
+ psr = getpsr();
+ setpsr(psr | PSR_PIL);
*uip |= v;
+ setpsr(psr);
}
static __inline void
atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
{
+ int psr;
+
+ psr = getpsr();
+ setpsr(psr | PSR_PIL);
*uip &= ~v;
+ setpsr(psr);
}
#endif /* defined(_KERNEL) */