summaryrefslogtreecommitdiff
path: root/linux/src
diff options
context:
space:
mode:
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 */