diff options
author | 2017-05-12 08:48:31 +0000 | |
---|---|---|
committer | 2017-05-12 08:48:31 +0000 | |
commit | 5363cf3257a77f3082febb1827af5ab6fd11b306 (patch) | |
tree | 4a6b3d42768ed9cb61f6c104d29c9a6988b7b9ae | |
parent | Make atomic.h ready to be included in userland. (diff) | |
download | wireguard-openbsd-5363cf3257a77f3082febb1827af5ab6fd11b306.tar.xz wireguard-openbsd-5363cf3257a77f3082febb1827af5ab6fd11b306.zip |
Make atomic.h ready to be included in userland.
- keep setbits/clearbits and virtio barriers inside _KERNEL
ok dlg@, kettenis@
-rw-r--r-- | sys/arch/arm64/include/atomic.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/arm64/include/atomic.h b/sys/arch/arm64/include/atomic.h index 7de934ca7d0..5cf42178cb5 100644 --- a/sys/arch/arm64/include/atomic.h +++ b/sys/arch/arm64/include/atomic.h @@ -1,12 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.2 2017/02/04 04:17:43 jsg Exp $ */ +/* $OpenBSD: atomic.h,v 1.3 2017/05/12 08:48:31 mpi Exp $ */ /* Public Domain */ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ -#if defined(_KERNEL) - #define __membar(_f) do { __asm __volatile(_f ::: "memory"); } while (0) #define membar_enter() __membar("dmb sy") @@ -15,6 +13,8 @@ #define membar_consumer() __membar("dmb ld") #define membar_sync() __membar("dmb sy") +#if defined(_KERNEL) + /* virtio needs MP membars even on SP kernels */ #define virtio_membar_producer() __membar("dmb st") #define virtio_membar_consumer() __membar("dmb ld") |