diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-15 11:53:01 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-08-15 12:07:12 +0200 |
commit | 2cdb55a93f5dbf032fab0102758c40b08dc9dab8 (patch) | |
tree | 1c76ce291e969381e6b5df4567721798c9a60669 /kern | |
parent | 3db15a3f80f193826e144b1944727a65c13340fe (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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kern/macros.h b/kern/macros.h index fb8dc5e..7cc579d 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))) |