diff options
Diffstat (limited to 'include/linux/compiler-gcc4.h')
-rw-r--r-- | include/linux/compiler-gcc4.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index a03e9398a6c2..14f7494280f0 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -23,3 +23,21 @@ | |||
23 | * code | 23 | * code |
24 | */ | 24 | */ |
25 | #define uninitialized_var(x) x = x | 25 | #define uninitialized_var(x) x = x |
26 | |||
27 | #if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3) | ||
28 | /* Mark functions as cold. gcc will assume any path leading to a call | ||
29 | to them will be unlikely. This means a lot of manual unlikely()s | ||
30 | are unnecessary now for any paths leading to the usual suspects | ||
31 | like BUG(), printk(), panic() etc. [but let's keep them for now for | ||
32 | older compilers] | ||
33 | |||
34 | Early snapshots of gcc 4.3 don't support this and we can't detect this | ||
35 | in the preprocessor, but we can live with this because they're unreleased. | ||
36 | Maketime probing would be overkill here. | ||
37 | |||
38 | gcc also has a __attribute__((__hot__)) to move hot functions into | ||
39 | a special section, but I don't see any sense in this right now in | ||
40 | the kernel context */ | ||
41 | #define __cold __attribute__((__cold__)) | ||
42 | |||
43 | #endif | ||