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: Use dsb(sy/st/ld)...



details:   https://anonhg.NetBSD.org/src/rev/7248c9fed879
branches:  trunk
changeset: 368562:7248c9fed879
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jul 19 16:38:22 2022 +0000

description:
linux: Use dsb(sy/st/ld) from arm/cpufunc.h for mb/wmb/rmb.

Works on more Arm CPU types this way.  From skrll.

diffstat:

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

diffs (27 lines):

diff -r a6d21c1ab738 -r 7248c9fed879 sys/external/bsd/common/include/asm/barrier.h
--- a/sys/external/bsd/common/include/asm/barrier.h     Tue Jul 19 08:22:34 2022 +0000
+++ b/sys/external/bsd/common/include/asm/barrier.h     Tue Jul 19 16:38:22 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: barrier.h,v 1.15 2022/07/17 22:02:23 riastradh Exp $   */
+/*     $NetBSD: barrier.h,v 1.16 2022/07/19 16:38:22 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -51,11 +51,13 @@
  * doesn't pass around the bus space tag and handle needed for that.
  */
 #if defined(__aarch64__)
-#define        mb()    __asm __volatile ("dsb sy" ::: "memory")
-#define        wmb()   __asm __volatile ("dsb st" ::: "memory")
-#define        rmb()   __asm __volatile ("dsb ld" ::: "memory")
+#include <arm/cpufunc.h>
+#define        mb()    dsb(sy)
+#define        wmb()   dsb(st)
+#define        rmb()   dsb(ld)
 #elif defined(__arm__)
-#define        mb()    __asm __volatile ("dsb" ::: "memory")
+#include <arm/cpufunc.h>
+#define        mb()    dsb()
 #define        wmb()   mb()
 #define        rmb()   mb()
 #elif defined(__i386__) || defined(__x86_64__)



Home | Main Index | Thread Index | Old Index