Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/common/include/asm linux: For uniprocessor,...



details:   https://anonhg.NetBSD.org/src/rev/c6c090ffd311
branches:  trunk
changeset: 1028894:c6c090ffd311
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:25:20 2021 +0000

description:
linux: For uniprocessor, define smp_*mb as __insn_barrier.

Otherwise ordering might not be guaranteed in the event of
preemption.

XXX pullup

diffstat:

 sys/external/bsd/common/include/asm/barrier.h |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (22 lines):

diff -r 040414bf5b2c -r c6c090ffd311 sys/external/bsd/common/include/asm/barrier.h
--- a/sys/external/bsd/common/include/asm/barrier.h     Sun Dec 19 12:25:11 2021 +0000
+++ b/sys/external/bsd/common/include/asm/barrier.h     Sun Dec 19 12:25:20 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: barrier.h,v 1.10 2021/12/19 12:25:11 riastradh Exp $   */
+/*     $NetBSD: barrier.h,v 1.11 2021/12/19 12:25:20 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -62,9 +62,9 @@
 #  define      smp_wmb                         membar_producer
 #  define      smp_rmb                         membar_consumer
 #else
-#  define      smp_mb()                        do {} while (0)
-#  define      smp_wmb()                       do {} while (0)
-#  define      smp_rmb()                       do {} while (0)
+#  define      smp_mb()                        __insn_barrier()
+#  define      smp_wmb()                       __insn_barrier()
+#  define      smp_rmb()                       __insn_barrier()
 #endif
 
 #if defined(MULTIPROCESSOR) && !defined(__HAVE_ATOMIC_AS_MEMBAR)



Home | Main Index | Thread Index | Old Index