diff options
Diffstat (limited to 'include/linux/compiler-gcc.h')
| -rw-r--r-- | include/linux/compiler-gcc.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 73dcf804bc94..16508bcddacc 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -35,8 +35,7 @@ | |||
| 35 | (typeof(ptr)) (__ptr + (off)); }) | 35 | (typeof(ptr)) (__ptr + (off)); }) |
| 36 | 36 | ||
| 37 | /* &a[0] degrades to a pointer: a different type from an array */ | 37 | /* &a[0] degrades to a pointer: a different type from an array */ |
| 38 | #define __must_be_array(a) \ | 38 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) |
| 39 | BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0]))) | ||
| 40 | 39 | ||
| 41 | /* | 40 | /* |
| 42 | * Force always-inline if the user requests it so via the .config, | 41 | * Force always-inline if the user requests it so via the .config, |
| @@ -58,8 +57,12 @@ | |||
| 58 | * naked functions because then mcount is called without stack and frame pointer | 57 | * naked functions because then mcount is called without stack and frame pointer |
| 59 | * being set up and there is no chance to restore the lr register to the value | 58 | * being set up and there is no chance to restore the lr register to the value |
| 60 | * before mcount was called. | 59 | * before mcount was called. |
| 60 | * | ||
| 61 | * The asm() bodies of naked functions often depend on standard calling conventions, | ||
| 62 | * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce | ||
| 63 | * this, so we must do so ourselves. See GCC PR44290. | ||
| 61 | */ | 64 | */ |
| 62 | #define __naked __attribute__((naked)) notrace | 65 | #define __naked __attribute__((naked)) noinline __noclone notrace |
| 63 | 66 | ||
| 64 | #define __noreturn __attribute__((noreturn)) | 67 | #define __noreturn __attribute__((noreturn)) |
| 65 | 68 | ||
| @@ -85,3 +88,7 @@ | |||
| 85 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) | 88 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) |
| 86 | #define gcc_header(x) _gcc_header(x) | 89 | #define gcc_header(x) _gcc_header(x) |
| 87 | #include gcc_header(__GNUC__) | 90 | #include gcc_header(__GNUC__) |
| 91 | |||
| 92 | #if !defined(__noclone) | ||
| 93 | #define __noclone /* not needed */ | ||
| 94 | #endif | ||
