summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-03-15 06:18:01 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-03-15 06:18:01 +0000
commit04fb61f5b786576529c7d205ed6e9874849be523 (patch)
tree66e01b495eb3999df7b057c983810a39b9c0b27e /sys
parenta7e1640c72e74fb961251dc3d069831ed3bde394 (diff)
make the membars look more correct for any memory ordering mode.
ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/include/atomic.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/arch/sparc64/include/atomic.h b/sys/arch/sparc64/include/atomic.h
index 47c81401708..84f6e1c411c 100644
--- a/sys/arch/sparc64/include/atomic.h
+++ b/sys/arch/sparc64/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.9 2014/01/30 12:27:10 kettenis Exp $ */
+/* $OpenBSD: atomic.h,v 1.10 2014/03/15 06:18:00 dlg Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
*
@@ -129,15 +129,11 @@ atomic_clearbits_int(volatile unsigned int *uip, unsigned int v)
} while (r != e);
}
-#if KERN_MM != PSTATE_MM_TSO
-#error membar operations only support KERN_MM = PSTATE_MM_TSO
-#endif
-
-#define membar_enter() membar(LoadLoad)
-#define membar_exit() membar(LoadLoad)
-#define membar_producer() membar(0)
+#define membar_enter() membar(StoreLoad|StoreStore)
+#define membar_exit() membar(LoadStore|StoreStore)
+#define membar_producer() membar(StoreStore)
#define membar_consumer() membar(LoadLoad)
-#define membar_sync() membar(LoadLoad)
+#define membar_sync() membar(Sync)
#endif /* defined(_KERNEL) */
#endif /* _MACHINE_ATOMIC_H_ */