diff options
Diffstat (limited to 'sys/arch/m88k/include/atomic.h')
-rw-r--r-- | sys/arch/m88k/include/atomic.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/sys/arch/m88k/include/atomic.h b/sys/arch/m88k/include/atomic.h index 874764cd729..6dba1393f5a 100644 --- a/sys/arch/m88k/include/atomic.h +++ b/sys/arch/m88k/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.5 2007/12/05 22:09:13 miod Exp $ */ +/* $OpenBSD: atomic.h,v 1.6 2009/02/20 20:40:01 miod Exp $ */ /* Public Domain */ @@ -7,14 +7,17 @@ #if defined(_KERNEL) +#ifdef MULTIPROCESSOR + +/* actual implementation is hairy, see atomic.S */ +void atomic_setbits_int(__volatile unsigned int *, unsigned int); +void atomic_clearbits_int(__volatile unsigned int *, unsigned int); + +#else + #include <machine/asm_macro.h> -#include <machine/lock.h> #include <machine/psl.h> -#ifdef MULTIPROCESSOR -extern __cpu_simple_lock_t __atomic_lock; -#endif - static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -22,13 +25,7 @@ atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) psr = get_psr(); set_psr(psr | PSR_IND); -#ifdef MULTIPROCESSOR - __cpu_simple_lock(&__atomic_lock); -#endif *uip |= v; -#ifdef MULTIPROCESSOR - __cpu_simple_unlock(&__atomic_lock); -#endif set_psr(psr); } @@ -39,15 +36,11 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) psr = get_psr(); set_psr(psr | PSR_IND); -#ifdef MULTIPROCESSOR - __cpu_simple_lock(&__atomic_lock); -#endif *uip &= ~v; -#ifdef MULTIPROCESSOR - __cpu_simple_unlock(&__atomic_lock); -#endif set_psr(psr); } +#endif /* MULTIPROCESSOR */ + #endif /* defined(_KERNEL) */ #endif /* __M88K_ATOMIC_H__ */ |