diff options
| -rw-r--r-- | include/linux/compiler-gcc4.h | 14 | ||||
| -rw-r--r-- | include/linux/compiler.h | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 450fa597c94d..ab3af40a53c6 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
| @@ -36,4 +36,18 @@ | |||
| 36 | the kernel context */ | 36 | the kernel context */ |
| 37 | #define __cold __attribute__((__cold__)) | 37 | #define __cold __attribute__((__cold__)) |
| 38 | 38 | ||
| 39 | |||
| 40 | #if __GNUC_MINOR__ >= 5 | ||
| 41 | /* | ||
| 42 | * Mark a position in code as unreachable. This can be used to | ||
| 43 | * suppress control flow warnings after asm blocks that transfer | ||
| 44 | * control elsewhere. | ||
| 45 | * | ||
| 46 | * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
| 47 | * this in the preprocessor, but we can live with this because they're | ||
| 48 | * unreleased. Really, we need to have autoconf for the kernel. | ||
| 49 | */ | ||
| 50 | #define unreachable() __builtin_unreachable() | ||
| 51 | #endif | ||
| 52 | |||
| 39 | #endif | 53 | #endif |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 04fb5135b4e1..59f208926d13 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -144,6 +144,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 144 | # define barrier() __memory_barrier() | 144 | # define barrier() __memory_barrier() |
| 145 | #endif | 145 | #endif |
| 146 | 146 | ||
| 147 | /* Unreachable code */ | ||
| 148 | #ifndef unreachable | ||
| 149 | # define unreachable() do { } while (1) | ||
| 150 | #endif | ||
| 151 | |||
| 147 | #ifndef RELOC_HIDE | 152 | #ifndef RELOC_HIDE |
| 148 | # define RELOC_HIDE(ptr, off) \ | 153 | # define RELOC_HIDE(ptr, off) \ |
| 149 | ({ unsigned long __ptr; \ | 154 | ({ unsigned long __ptr; \ |
