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/linux Move attributes, barri...



details:   https://anonhg.NetBSD.org/src/rev/e1694681b986
branches:  trunk
changeset: 1028030:e1694681b986
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:41:21 2021 +0000

description:
Move attributes, barrier(), and likely/unlikely to linux/compiler.h.

diffstat:

 sys/external/bsd/common/include/linux/compiler.h |  19 ++++++++++++++++++-
 sys/external/bsd/common/include/linux/kernel.h   |  18 +-----------------
 2 files changed, 19 insertions(+), 18 deletions(-)

diffs (68 lines):

diff -r afb38714126c -r e1694681b986 sys/external/bsd/common/include/linux/compiler.h
--- a/sys/external/bsd/common/include/linux/compiler.h  Sun Dec 19 01:41:12 2021 +0000
+++ b/sys/external/bsd/common/include/linux/compiler.h  Sun Dec 19 01:41:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compiler.h,v 1.3 2021/12/19 01:24:36 riastradh Exp $   */
+/*     $NetBSD: compiler.h,v 1.4 2021/12/19 01:41:21 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -33,9 +33,26 @@
 #define        _LINUX_COMPILER_H_
 
 #include <sys/atomic.h>
+#include <sys/cdefs.h>
 
 #include <asm/barrier.h>
 
+#define        __printf        __printflike
+#define        __user
+#if __GNUC_PREREQ__(4,0)       /* not sure when but this will work */
+#define        __must_check    __attribute__((warn_unused_result))
+#else
+#define        __must_check    /* nothing */
+#endif
+#define        __always_unused __unused
+#define        __maybe_unused  __unused
+#define        noinline        __noinline
+#define        __deprecated    /* nothing */
+
+#define        barrier()       __insn_barrier()
+#define        likely(X)       __predict_true(X)
+#define        unlikely(X)     __predict_false(X)
+
 #define        READ_ONCE(X)    ({                                                    \
        typeof(X) __read_once_tmp = (X);                                      \
        membar_datadep_consumer();                                            \
diff -r afb38714126c -r e1694681b986 sys/external/bsd/common/include/linux/kernel.h
--- a/sys/external/bsd/common/include/linux/kernel.h    Sun Dec 19 01:41:12 2021 +0000
+++ b/sys/external/bsd/common/include/linux/kernel.h    Sun Dec 19 01:41:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernel.h,v 1.37 2021/12/19 01:40:20 riastradh Exp $    */
+/*     $NetBSD: kernel.h,v 1.38 2021/12/19 01:41:21 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -65,22 +65,6 @@
 #define        IS_ENABLED(option)      (option)
 #define        IS_REACHABLE(option)    (option)
 
-#define        __printf        __printflike
-#define        __user
-#if __GNUC_PREREQ__(4,0)       /* not sure when but this will work */
-#define        __must_check    __attribute__((warn_unused_result))
-#else
-#define        __must_check    /* nothing */
-#endif
-#define        __always_unused __unused
-#define        __maybe_unused  __unused
-#define        noinline        __noinline
-#define        __deprecated    /* nothing */
-
-#define        barrier()       __insn_barrier()
-#define        likely(X)       __predict_true(X)
-#define        unlikely(X)     __predict_false(X)
-
 #define        might_sleep     ASSERT_SLEEPABLE
 
 #define        DEFINE_STATIC_KEY_FALSE(N)      bool N __unused = false



Home | Main Index | Thread Index | Old Index