summaryrefslogtreecommitdiff
path: root/linux/src
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 /linux/src
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 'linux/src')
-rw-r--r--linux/src/include/linux/compiler-gcc.h2
-rw-r--r--linux/src/include/linux/compiler.h8
2 files changed, 8 insertions, 2 deletions
diff --git a/linux/src/include/linux/compiler-gcc.h b/linux/src/include/linux/compiler-gcc.h
index 59e4028..b1a0be0 100644
--- a/linux/src/include/linux/compiler-gcc.h
+++ b/linux/src/include/linux/compiler-gcc.h
@@ -9,7 +9,9 @@
/* Optimization barrier */
/* The "volatile" is due to gcc bugs */
+#ifndef barrier
#define barrier() __asm__ __volatile__("": : :"memory")
+#endif /* barrier */
/*
* This macro obfuscates arithmetic on a variable address so that gcc
diff --git a/linux/src/include/linux/compiler.h b/linux/src/include/linux/compiler.h
index 320d6c9..eb3dd94 100644
--- a/linux/src/include/linux/compiler.h
+++ b/linux/src/include/linux/compiler.h
@@ -143,8 +143,12 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
#endif /* CONFIG_PROFILE_ALL_BRANCHES */
#else
-# define likely(x) __builtin_expect(!!(x), 1)
-# define unlikely(x) __builtin_expect(!!(x), 0)
+# ifndef likely
+# define likely(x) __builtin_expect(!!(x), 1)
+# endif /* likely */
+# ifndef unlikely
+# define unlikely(x) __builtin_expect(!!(x), 0)
+# endif /* unlikely */
#endif
/* Optimization barrier */