summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-08-15 11:53:01 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-08-15 12:07:12 +0200
commit2cdb55a93f5dbf032fab0102758c40b08dc9dab8 (patch)
tree1c76ce291e969381e6b5df4567721798c9a60669 /kern
parent3db15a3f80f193826e144b1944727a65c13340fe (diff)
Avoid re-defining macros
* kern/macros.h: Avoid re-defining macros. * linux/src/include/linux/compiler-gcc.h: Likewise. * linux/src/include/linux/compiler.h: Likewise.
Diffstat (limited to 'kern')
-rw-r--r--kern/macros.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/kern/macros.h b/kern/macros.h
index fb8dc5e1..7cc579d1 100644
--- a/kern/macros.h
+++ b/kern/macros.h
@@ -54,15 +54,23 @@
#define alignof(x) __alignof__(x)
+#ifndef likely
#define likely(expr) __builtin_expect(!!(expr), 1)
+#endif /* likely */
+#ifndef unlikely
#define unlikely(expr) __builtin_expect(!!(expr), 0)
+#endif /* unlikely */
+#ifndef barrier
#define barrier() asm volatile("" : : : "memory")
+#endif /* barrier */
#define __noreturn __attribute__((noreturn))
#define __aligned(x) __attribute__((aligned(x)))
#define __always_inline inline __attribute__((always_inline))
+#ifndef __section
#define __section(x) __attribute__((section(x)))
+#endif /* __section */
#define __packed __attribute__((packed))
#define __alias(x) __attribute__((alias(x)))