summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-05-12 08:47:48 +0000
committermpi <mpi@openbsd.org>2017-05-12 08:47:48 +0000
commit7886579d84ca239a2c2855189cc61e403f9f0360 (patch)
tree83d02a28b46baa5f3964fb9c137b6fad77dbb82d
parentMake atomic.h ready to be included in userland. (diff)
downloadwireguard-openbsd-7886579d84ca239a2c2855189cc61e403f9f0360.tar.xz
wireguard-openbsd-7886579d84ca239a2c2855189cc61e403f9f0360.zip
Make atomic.h ready to be included in userland.
- keep setbits/clearbits inside _KERNEL ok dlg@, kettenis@
-rw-r--r--sys/arch/powerpc/include/atomic.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/powerpc/include/atomic.h b/sys/arch/powerpc/include/atomic.h
index bb9eb31d8ba..4af7cff445d 100644
--- a/sys/arch/powerpc/include/atomic.h
+++ b/sys/arch/powerpc/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.10 2015/05/06 03:30:03 dlg Exp $ */
+/* $OpenBSD: atomic.h,v 1.11 2017/05/12 08:47:48 mpi Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
@@ -48,6 +48,8 @@ atomic_clearbits_int(volatile unsigned int *uip, unsigned int v)
" sync" : "=&r" (tmp) : "r" (v), "r" (uip) : "cc", "memory");
}
+#endif /* defined(_KERNEL) */
+
static inline unsigned int
_atomic_cas_uint(volatile unsigned int *p, unsigned int o, unsigned int n)
{
@@ -273,7 +275,7 @@ _atomic_addic_long_nv(volatile unsigned long *p, unsigned long v)
#define __membar(_f) do { __asm __volatile(_f ::: "memory"); } while (0)
-#ifdef MULTIPROCESSOR
+#if defined(MULTIPROCESSOR) || !defined(_KERNEL)
#define membar_enter() __membar("isync")
#define membar_exit() __membar("sync")
#define membar_producer() __membar("sync")
@@ -287,5 +289,4 @@ _atomic_addic_long_nv(volatile unsigned long *p, unsigned long v)
#define membar_sync() __membar("")
#endif
-#endif /* defined(_KERNEL) */
#endif /* _POWERPC_ATOMIC_H_ */