diff options
author | 2007-04-27 19:22:47 +0000 | |
---|---|---|
committer | 2007-04-27 19:22:47 +0000 | |
commit | fe54a11e5f1a656be515dbc48f2985ca35e556b9 (patch) | |
tree | 4ea9e4faaa8afa458f5448660f3ce6e18639839f | |
parent | Enable interrupts during syscall processing. Need to verify if the (diff) | |
download | wireguard-openbsd-fe54a11e5f1a656be515dbc48f2985ca35e556b9.tar.xz wireguard-openbsd-fe54a11e5f1a656be515dbc48f2985ca35e556b9.zip |
Disable interrupts around bit operations; ok deraadt@
-rw-r--r-- | sys/arch/sparc/include/atomic.h | 12 |
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) */ |