summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-10-26 04:01:20 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-10-26 04:01:20 +0000
commit4ce9e8dacf8b10b5355981add9170127bf5980b7 (patch)
tree9b4fd620e15e1944d18b21e5d55569433422cdd4 /sys
parent0fd098d9242fe772b41459e34be22f3b81997679 (diff)
use __membar() where possible
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/include/linux/atomic.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/pci/drm/include/linux/atomic.h b/sys/dev/pci/drm/include/linux/atomic.h
index 501ef8fd972..d2a47dd7229 100644
--- a/sys/dev/pci/drm/include/linux/atomic.h
+++ b/sys/dev/pci/drm/include/linux/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.11 2020/10/26 03:00:15 jsg Exp $ */
+/* $OpenBSD: atomic.h,v 1.12 2020/10/26 04:01:19 jsg Exp $ */
/**
* \file drm_atomic.h
* Atomic operations used in the DRM which may or may not be provided by the OS.
@@ -388,8 +388,8 @@ find_next_bit(volatile void *p, int max, int b)
#define wmb() __asm __volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc")
#define mb() __asm __volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc")
#define smp_mb() __asm __volatile("lock; addl $0,-4(%%esp)" : : : "memory", "cc")
-#define smp_rmb() __asm __volatile("" : : : "memory")
-#define smp_wmb() __asm __volatile("" : : : "memory")
+#define smp_rmb() __membar("")
+#define smp_wmb() __membar("")
#define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
#define smp_mb__after_atomic() do { } while (0)
#define smp_mb__before_atomic() do { } while (0)
@@ -398,12 +398,12 @@ find_next_bit(volatile void *p, int max, int b)
#define wmb() alpha_wmb();
#define mb() alpha_mb();
#elif defined(__amd64__)
-#define rmb() __asm __volatile("lfence" : : : "memory")
-#define wmb() __asm __volatile("sfence" : : : "memory")
-#define mb() __asm __volatile("mfence" : : : "memory")
-#define smp_mb() __asm __volatile("lock; addl $0,-4(%%rsp)" : : : "memory", "cc");
-#define smp_rmb() __asm __volatile("" : : : "memory")
-#define smp_wmb() __asm __volatile("" : : : "memory")
+#define rmb() __membar("lfence")
+#define wmb() __membar("sfence")
+#define mb() __membar("mfence")
+#define smp_mb() __asm __volatile("lock; addl $0,-4(%%rsp)" : : : "memory", "cc")
+#define smp_rmb() __membar("")
+#define smp_wmb() __membar("")
#define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
#define smp_mb__after_atomic() do { } while (0)
#define smp_mb__before_atomic() do { } while (0)