diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-26 12:52:05 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-26 12:52:05 -0400 |
| commit | 47a469421d792dcb91a1e73319d26134241953d2 (patch) | |
| tree | 6a388381a434ebe87fed2fbb10a53ced7a7ce8b5 /include | |
| parent | c13c81006314ad76c2b31824960a900385601b8b (diff) | |
| parent | 51229b495340bd7a02ce3622d1966829b67054ea (diff) | |
Merge branch 'akpm' (patches from Andrew)
Merge second patchbomb from Andrew Morton:
- most of the rest of MM
- lots of misc things
- procfs updates
- printk feature work
- updates to get_maintainer, MAINTAINERS, checkpatch
- lib/ updates
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (96 commits)
exit,stats: /* obey this comment */
coredump: add __printf attribute to cn_*printf functions
coredump: use from_kuid/kgid when formatting corename
fs/reiserfs: remove unneeded cast
NILFS2: support NFSv2 export
fs/befs/btree.c: remove unneeded initializations
fs/minix: remove unneeded cast
init/do_mounts.c: add create_dev() failure log
kasan: remove duplicate definition of the macro KASAN_FREE_PAGE
fs/efs: femove unneeded cast
checkpatch: emit "NOTE: <types>" message only once after multiple files
checkpatch: emit an error when there's a diff in a changelog
checkpatch: validate MODULE_LICENSE content
checkpatch: add multi-line handling for PREFER_ETHER_ADDR_COPY
checkpatch: suggest using eth_zero_addr() and eth_broadcast_addr()
checkpatch: fix processing of MEMSET issues
checkpatch: suggest using ether_addr_equal*()
checkpatch: avoid NOT_UNIFIED_DIFF errors on cover-letter.patch files
checkpatch: remove local from codespell path
checkpatch: add --showfile to allow input via pipe to show filenames
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/compiler-gcc.h | 207 | ||||
| -rw-r--r-- | include/linux/compiler-gcc3.h | 23 | ||||
| -rw-r--r-- | include/linux/compiler-gcc4.h | 91 | ||||
| -rw-r--r-- | include/linux/compiler-gcc5.h | 67 | ||||
| -rw-r--r-- | include/linux/compiler-intel.h | 2 | ||||
| -rw-r--r-- | include/linux/console.h | 1 | ||||
| -rw-r--r-- | include/linux/printk.h | 2 | ||||
| -rw-r--r-- | include/linux/sched.h | 15 | ||||
| -rw-r--r-- | include/linux/stddef.h | 8 | ||||
| -rw-r--r-- | include/linux/string.h | 1 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 6 | ||||
| -rw-r--r-- | include/linux/syslog.h | 6 | ||||
| -rw-r--r-- | include/linux/zpool.h | 5 |
13 files changed, 195 insertions, 239 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 371e560d13cf..dfaa7b3e9ae9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | /* | 5 | /* |
| 6 | * Common definitions for all gcc versions go here. | 6 | * Common definitions for all gcc versions go here. |
| 7 | */ | 7 | */ |
| 8 | #define GCC_VERSION (__GNUC__ * 10000 \ | 8 | #define GCC_VERSION (__GNUC__ * 10000 \ |
| 9 | + __GNUC_MINOR__ * 100 \ | 9 | + __GNUC_MINOR__ * 100 \ |
| 10 | + __GNUC_PATCHLEVEL__) | 10 | + __GNUC_PATCHLEVEL__) |
| 11 | 11 | ||
| 12 | /* Optimization barrier */ | 12 | /* Optimization barrier */ |
| 13 | 13 | ||
| @@ -46,55 +46,63 @@ | |||
| 46 | * the inline assembly constraint from =g to =r, in this particular | 46 | * the inline assembly constraint from =g to =r, in this particular |
| 47 | * case either is valid. | 47 | * case either is valid. |
| 48 | */ | 48 | */ |
| 49 | #define RELOC_HIDE(ptr, off) \ | 49 | #define RELOC_HIDE(ptr, off) \ |
| 50 | ({ unsigned long __ptr; \ | 50 | ({ \ |
| 51 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ | 51 | unsigned long __ptr; \ |
| 52 | (typeof(ptr)) (__ptr + (off)); }) | 52 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ |
| 53 | (typeof(ptr)) (__ptr + (off)); \ | ||
| 54 | }) | ||
| 53 | 55 | ||
| 54 | /* Make the optimizer believe the variable can be manipulated arbitrarily. */ | 56 | /* Make the optimizer believe the variable can be manipulated arbitrarily. */ |
| 55 | #define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) | 57 | #define OPTIMIZER_HIDE_VAR(var) \ |
| 58 | __asm__ ("" : "=r" (var) : "0" (var)) | ||
| 56 | 59 | ||
| 57 | #ifdef __CHECKER__ | 60 | #ifdef __CHECKER__ |
| 58 | #define __must_be_array(arr) 0 | 61 | #define __must_be_array(a) 0 |
| 59 | #else | 62 | #else |
| 60 | /* &a[0] degrades to a pointer: a different type from an array */ | 63 | /* &a[0] degrades to a pointer: a different type from an array */ |
| 61 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | 64 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) |
| 62 | #endif | 65 | #endif |
| 63 | 66 | ||
| 64 | /* | 67 | /* |
| 65 | * Force always-inline if the user requests it so via the .config, | 68 | * Force always-inline if the user requests it so via the .config, |
| 66 | * or if gcc is too old: | 69 | * or if gcc is too old: |
| 67 | */ | 70 | */ |
| 68 | #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ | 71 | #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ |
| 69 | !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) | 72 | !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) |
| 70 | # define inline inline __attribute__((always_inline)) notrace | 73 | #define inline inline __attribute__((always_inline)) notrace |
| 71 | # define __inline__ __inline__ __attribute__((always_inline)) notrace | 74 | #define __inline__ __inline__ __attribute__((always_inline)) notrace |
| 72 | # define __inline __inline __attribute__((always_inline)) notrace | 75 | #define __inline __inline __attribute__((always_inline)) notrace |
| 73 | #else | 76 | #else |
| 74 | /* A lot of inline functions can cause havoc with function tracing */ | 77 | /* A lot of inline functions can cause havoc with function tracing */ |
| 75 | # define inline inline notrace | 78 | #define inline inline notrace |
| 76 | # define __inline__ __inline__ notrace | 79 | #define __inline__ __inline__ notrace |
| 77 | # define __inline __inline notrace | 80 | #define __inline __inline notrace |
| 78 | #endif | 81 | #endif |
| 79 | 82 | ||
| 80 | #define __deprecated __attribute__((deprecated)) | 83 | #define __always_inline inline __attribute__((always_inline)) |
| 81 | #define __packed __attribute__((packed)) | 84 | #define noinline __attribute__((noinline)) |
| 82 | #define __weak __attribute__((weak)) | 85 | |
| 83 | #define __alias(symbol) __attribute__((alias(#symbol))) | 86 | #define __deprecated __attribute__((deprecated)) |
| 87 | #define __packed __attribute__((packed)) | ||
| 88 | #define __weak __attribute__((weak)) | ||
| 89 | #define __alias(symbol) __attribute__((alias(#symbol))) | ||
| 84 | 90 | ||
| 85 | /* | 91 | /* |
| 86 | * it doesn't make sense on ARM (currently the only user of __naked) to trace | 92 | * it doesn't make sense on ARM (currently the only user of __naked) |
| 87 | * naked functions because then mcount is called without stack and frame pointer | 93 | * to trace naked functions because then mcount is called without |
| 88 | * being set up and there is no chance to restore the lr register to the value | 94 | * stack and frame pointer being set up and there is no chance to |
| 89 | * before mcount was called. | 95 | * restore the lr register to the value before mcount was called. |
| 96 | * | ||
| 97 | * The asm() bodies of naked functions often depend on standard calling | ||
| 98 | * conventions, therefore they must be noinline and noclone. | ||
| 90 | * | 99 | * |
| 91 | * The asm() bodies of naked functions often depend on standard calling conventions, | 100 | * GCC 4.[56] currently fail to enforce this, so we must do so ourselves. |
| 92 | * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce | 101 | * See GCC PR44290. |
| 93 | * this, so we must do so ourselves. See GCC PR44290. | ||
| 94 | */ | 102 | */ |
| 95 | #define __naked __attribute__((naked)) noinline __noclone notrace | 103 | #define __naked __attribute__((naked)) noinline __noclone notrace |
| 96 | 104 | ||
| 97 | #define __noreturn __attribute__((noreturn)) | 105 | #define __noreturn __attribute__((noreturn)) |
| 98 | 106 | ||
| 99 | /* | 107 | /* |
| 100 | * From the GCC manual: | 108 | * From the GCC manual: |
| @@ -106,19 +114,130 @@ | |||
| 106 | * would be. | 114 | * would be. |
| 107 | * [...] | 115 | * [...] |
| 108 | */ | 116 | */ |
| 109 | #define __pure __attribute__((pure)) | 117 | #define __pure __attribute__((pure)) |
| 110 | #define __aligned(x) __attribute__((aligned(x))) | 118 | #define __aligned(x) __attribute__((aligned(x))) |
| 111 | #define __printf(a, b) __attribute__((format(printf, a, b))) | 119 | #define __printf(a, b) __attribute__((format(printf, a, b))) |
| 112 | #define __scanf(a, b) __attribute__((format(scanf, a, b))) | 120 | #define __scanf(a, b) __attribute__((format(scanf, a, b))) |
| 113 | #define noinline __attribute__((noinline)) | 121 | #define __attribute_const__ __attribute__((__const__)) |
| 114 | #define __attribute_const__ __attribute__((__const__)) | 122 | #define __maybe_unused __attribute__((unused)) |
| 115 | #define __maybe_unused __attribute__((unused)) | 123 | #define __always_unused __attribute__((unused)) |
| 116 | #define __always_unused __attribute__((unused)) | 124 | |
| 117 | 125 | /* gcc version specific checks */ | |
| 118 | #define __gcc_header(x) #x | 126 | |
| 119 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) | 127 | #if GCC_VERSION < 30200 |
| 120 | #define gcc_header(x) _gcc_header(x) | 128 | # error Sorry, your compiler is too old - please upgrade it. |
| 121 | #include gcc_header(__GNUC__) | 129 | #endif |
| 130 | |||
| 131 | #if GCC_VERSION < 30300 | ||
| 132 | # define __used __attribute__((__unused__)) | ||
| 133 | #else | ||
| 134 | # define __used __attribute__((__used__)) | ||
| 135 | #endif | ||
| 136 | |||
| 137 | #ifdef CONFIG_GCOV_KERNEL | ||
| 138 | # if GCC_VERSION < 30400 | ||
| 139 | # error "GCOV profiling support for gcc versions below 3.4 not included" | ||
| 140 | # endif /* __GNUC_MINOR__ */ | ||
| 141 | #endif /* CONFIG_GCOV_KERNEL */ | ||
| 142 | |||
| 143 | #if GCC_VERSION >= 30400 | ||
| 144 | #define __must_check __attribute__((warn_unused_result)) | ||
| 145 | #endif | ||
| 146 | |||
| 147 | #if GCC_VERSION >= 40000 | ||
| 148 | |||
| 149 | /* GCC 4.1.[01] miscompiles __weak */ | ||
| 150 | #ifdef __KERNEL__ | ||
| 151 | # if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 | ||
| 152 | # error Your version of gcc miscompiles the __weak directive | ||
| 153 | # endif | ||
| 154 | #endif | ||
| 155 | |||
| 156 | #define __used __attribute__((__used__)) | ||
| 157 | #define __compiler_offsetof(a, b) \ | ||
| 158 | __builtin_offsetof(a, b) | ||
| 159 | |||
| 160 | #if GCC_VERSION >= 40100 && GCC_VERSION < 40600 | ||
| 161 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
| 162 | #endif | ||
| 163 | |||
| 164 | #if GCC_VERSION >= 40300 | ||
| 165 | /* Mark functions as cold. gcc will assume any path leading to a call | ||
| 166 | * to them will be unlikely. This means a lot of manual unlikely()s | ||
| 167 | * are unnecessary now for any paths leading to the usual suspects | ||
| 168 | * like BUG(), printk(), panic() etc. [but let's keep them for now for | ||
| 169 | * older compilers] | ||
| 170 | * | ||
| 171 | * Early snapshots of gcc 4.3 don't support this and we can't detect this | ||
| 172 | * in the preprocessor, but we can live with this because they're unreleased. | ||
| 173 | * Maketime probing would be overkill here. | ||
| 174 | * | ||
| 175 | * gcc also has a __attribute__((__hot__)) to move hot functions into | ||
| 176 | * a special section, but I don't see any sense in this right now in | ||
| 177 | * the kernel context | ||
| 178 | */ | ||
| 179 | #define __cold __attribute__((__cold__)) | ||
| 180 | |||
| 181 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | ||
| 182 | |||
| 183 | #ifndef __CHECKER__ | ||
| 184 | # define __compiletime_warning(message) __attribute__((warning(message))) | ||
| 185 | # define __compiletime_error(message) __attribute__((error(message))) | ||
| 186 | #endif /* __CHECKER__ */ | ||
| 187 | #endif /* GCC_VERSION >= 40300 */ | ||
| 188 | |||
| 189 | #if GCC_VERSION >= 40500 | ||
| 190 | /* | ||
| 191 | * Mark a position in code as unreachable. This can be used to | ||
| 192 | * suppress control flow warnings after asm blocks that transfer | ||
| 193 | * control elsewhere. | ||
| 194 | * | ||
| 195 | * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
| 196 | * this in the preprocessor, but we can live with this because they're | ||
| 197 | * unreleased. Really, we need to have autoconf for the kernel. | ||
| 198 | */ | ||
| 199 | #define unreachable() __builtin_unreachable() | ||
| 200 | |||
| 201 | /* Mark a function definition as prohibited from being cloned. */ | ||
| 202 | #define __noclone __attribute__((__noclone__)) | ||
| 203 | |||
| 204 | #endif /* GCC_VERSION >= 40500 */ | ||
| 205 | |||
| 206 | #if GCC_VERSION >= 40600 | ||
| 207 | /* | ||
| 208 | * Tell the optimizer that something else uses this function or variable. | ||
| 209 | */ | ||
| 210 | #define __visible __attribute__((externally_visible)) | ||
| 211 | #endif | ||
| 212 | |||
| 213 | /* | ||
| 214 | * GCC 'asm goto' miscompiles certain code sequences: | ||
| 215 | * | ||
| 216 | * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 | ||
| 217 | * | ||
| 218 | * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. | ||
| 219 | * | ||
| 220 | * (asm goto is automatically volatile - the naming reflects this.) | ||
| 221 | */ | ||
| 222 | #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) | ||
| 223 | |||
| 224 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | ||
| 225 | #if GCC_VERSION >= 40400 | ||
| 226 | #define __HAVE_BUILTIN_BSWAP32__ | ||
| 227 | #define __HAVE_BUILTIN_BSWAP64__ | ||
| 228 | #endif | ||
| 229 | #if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) | ||
| 230 | #define __HAVE_BUILTIN_BSWAP16__ | ||
| 231 | #endif | ||
| 232 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | ||
| 233 | |||
| 234 | #if GCC_VERSION >= 50000 | ||
| 235 | #define KASAN_ABI_VERSION 4 | ||
| 236 | #elif GCC_VERSION >= 40902 | ||
| 237 | #define KASAN_ABI_VERSION 3 | ||
| 238 | #endif | ||
| 239 | |||
| 240 | #endif /* gcc version >= 40000 specific checks */ | ||
| 122 | 241 | ||
| 123 | #if !defined(__noclone) | 242 | #if !defined(__noclone) |
| 124 | #define __noclone /* not needed */ | 243 | #define __noclone /* not needed */ |
| @@ -129,5 +248,3 @@ | |||
| 129 | * code | 248 | * code |
| 130 | */ | 249 | */ |
| 131 | #define uninitialized_var(x) x = x | 250 | #define uninitialized_var(x) x = x |
| 132 | |||
| 133 | #define __always_inline inline __attribute__((always_inline)) | ||
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h deleted file mode 100644 index 7d89febe4d79..000000000000 --- a/include/linux/compiler-gcc3.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #ifndef __LINUX_COMPILER_H | ||
| 2 | #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." | ||
| 3 | #endif | ||
| 4 | |||
| 5 | #if GCC_VERSION < 30200 | ||
| 6 | # error Sorry, your compiler is too old - please upgrade it. | ||
| 7 | #endif | ||
| 8 | |||
| 9 | #if GCC_VERSION >= 30300 | ||
| 10 | # define __used __attribute__((__used__)) | ||
| 11 | #else | ||
| 12 | # define __used __attribute__((__unused__)) | ||
| 13 | #endif | ||
| 14 | |||
| 15 | #if GCC_VERSION >= 30400 | ||
| 16 | #define __must_check __attribute__((warn_unused_result)) | ||
| 17 | #endif | ||
| 18 | |||
| 19 | #ifdef CONFIG_GCOV_KERNEL | ||
| 20 | # if GCC_VERSION < 30400 | ||
| 21 | # error "GCOV profiling support for gcc versions below 3.4 not included" | ||
| 22 | # endif /* __GNUC_MINOR__ */ | ||
| 23 | #endif /* CONFIG_GCOV_KERNEL */ | ||
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h deleted file mode 100644 index 769e19864632..000000000000 --- a/include/linux/compiler-gcc4.h +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 1 | #ifndef __LINUX_COMPILER_H | ||
| 2 | #error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." | ||
| 3 | #endif | ||
| 4 | |||
| 5 | /* GCC 4.1.[01] miscompiles __weak */ | ||
| 6 | #ifdef __KERNEL__ | ||
| 7 | # if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 | ||
| 8 | # error Your version of gcc miscompiles the __weak directive | ||
| 9 | # endif | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #define __used __attribute__((__used__)) | ||
| 13 | #define __must_check __attribute__((warn_unused_result)) | ||
| 14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | ||
| 15 | |||
| 16 | #if GCC_VERSION >= 40100 && GCC_VERSION < 40600 | ||
| 17 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #if GCC_VERSION >= 40300 | ||
| 21 | /* Mark functions as cold. gcc will assume any path leading to a call | ||
| 22 | to them will be unlikely. This means a lot of manual unlikely()s | ||
| 23 | are unnecessary now for any paths leading to the usual suspects | ||
| 24 | like BUG(), printk(), panic() etc. [but let's keep them for now for | ||
| 25 | older compilers] | ||
| 26 | |||
| 27 | Early snapshots of gcc 4.3 don't support this and we can't detect this | ||
| 28 | in the preprocessor, but we can live with this because they're unreleased. | ||
| 29 | Maketime probing would be overkill here. | ||
| 30 | |||
| 31 | gcc also has a __attribute__((__hot__)) to move hot functions into | ||
| 32 | a special section, but I don't see any sense in this right now in | ||
| 33 | the kernel context */ | ||
| 34 | #define __cold __attribute__((__cold__)) | ||
| 35 | |||
| 36 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | ||
| 37 | |||
| 38 | #ifndef __CHECKER__ | ||
| 39 | # define __compiletime_warning(message) __attribute__((warning(message))) | ||
| 40 | # define __compiletime_error(message) __attribute__((error(message))) | ||
| 41 | #endif /* __CHECKER__ */ | ||
| 42 | #endif /* GCC_VERSION >= 40300 */ | ||
| 43 | |||
| 44 | #if GCC_VERSION >= 40500 | ||
| 45 | /* | ||
| 46 | * Mark a position in code as unreachable. This can be used to | ||
| 47 | * suppress control flow warnings after asm blocks that transfer | ||
| 48 | * control elsewhere. | ||
| 49 | * | ||
| 50 | * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
| 51 | * this in the preprocessor, but we can live with this because they're | ||
| 52 | * unreleased. Really, we need to have autoconf for the kernel. | ||
| 53 | */ | ||
| 54 | #define unreachable() __builtin_unreachable() | ||
| 55 | |||
| 56 | /* Mark a function definition as prohibited from being cloned. */ | ||
| 57 | #define __noclone __attribute__((__noclone__)) | ||
| 58 | |||
| 59 | #endif /* GCC_VERSION >= 40500 */ | ||
| 60 | |||
| 61 | #if GCC_VERSION >= 40600 | ||
| 62 | /* | ||
| 63 | * Tell the optimizer that something else uses this function or variable. | ||
| 64 | */ | ||
| 65 | #define __visible __attribute__((externally_visible)) | ||
| 66 | #endif | ||
| 67 | |||
| 68 | /* | ||
| 69 | * GCC 'asm goto' miscompiles certain code sequences: | ||
| 70 | * | ||
| 71 | * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 | ||
| 72 | * | ||
| 73 | * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. | ||
| 74 | * | ||
| 75 | * (asm goto is automatically volatile - the naming reflects this.) | ||
| 76 | */ | ||
| 77 | #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) | ||
| 78 | |||
| 79 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | ||
| 80 | #if GCC_VERSION >= 40400 | ||
| 81 | #define __HAVE_BUILTIN_BSWAP32__ | ||
| 82 | #define __HAVE_BUILTIN_BSWAP64__ | ||
| 83 | #endif | ||
| 84 | #if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) | ||
| 85 | #define __HAVE_BUILTIN_BSWAP16__ | ||
| 86 | #endif | ||
| 87 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | ||
| 88 | |||
| 89 | #if GCC_VERSION >= 40902 | ||
| 90 | #define KASAN_ABI_VERSION 3 | ||
| 91 | #endif | ||
diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h deleted file mode 100644 index efee493714eb..000000000000 --- a/include/linux/compiler-gcc5.h +++ /dev/null | |||
| @@ -1,67 +0,0 @@ | |||
| 1 | #ifndef __LINUX_COMPILER_H | ||
| 2 | #error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead." | ||
| 3 | #endif | ||
| 4 | |||
| 5 | #define __used __attribute__((__used__)) | ||
| 6 | #define __must_check __attribute__((warn_unused_result)) | ||
| 7 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b) | ||
| 8 | |||
| 9 | /* Mark functions as cold. gcc will assume any path leading to a call | ||
| 10 | to them will be unlikely. This means a lot of manual unlikely()s | ||
| 11 | are unnecessary now for any paths leading to the usual suspects | ||
| 12 | like BUG(), printk(), panic() etc. [but let's keep them for now for | ||
| 13 | older compilers] | ||
| 14 | |||
| 15 | Early snapshots of gcc 4.3 don't support this and we can't detect this | ||
| 16 | in the preprocessor, but we can live with this because they're unreleased. | ||
| 17 | Maketime probing would be overkill here. | ||
| 18 | |||
| 19 | gcc also has a __attribute__((__hot__)) to move hot functions into | ||
| 20 | a special section, but I don't see any sense in this right now in | ||
| 21 | the kernel context */ | ||
| 22 | #define __cold __attribute__((__cold__)) | ||
| 23 | |||
| 24 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | ||
| 25 | |||
| 26 | #ifndef __CHECKER__ | ||
| 27 | # define __compiletime_warning(message) __attribute__((warning(message))) | ||
| 28 | # define __compiletime_error(message) __attribute__((error(message))) | ||
| 29 | #endif /* __CHECKER__ */ | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Mark a position in code as unreachable. This can be used to | ||
| 33 | * suppress control flow warnings after asm blocks that transfer | ||
| 34 | * control elsewhere. | ||
| 35 | * | ||
| 36 | * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
| 37 | * this in the preprocessor, but we can live with this because they're | ||
| 38 | * unreleased. Really, we need to have autoconf for the kernel. | ||
| 39 | */ | ||
| 40 | #define unreachable() __builtin_unreachable() | ||
| 41 | |||
| 42 | /* Mark a function definition as prohibited from being cloned. */ | ||
| 43 | #define __noclone __attribute__((__noclone__)) | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Tell the optimizer that something else uses this function or variable. | ||
| 47 | */ | ||
| 48 | #define __visible __attribute__((externally_visible)) | ||
| 49 | |||
| 50 | /* | ||
| 51 | * GCC 'asm goto' miscompiles certain code sequences: | ||
| 52 | * | ||
| 53 | * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 | ||
| 54 | * | ||
| 55 | * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. | ||
| 56 | * | ||
| 57 | * (asm goto is automatically volatile - the naming reflects this.) | ||
| 58 | */ | ||
| 59 | #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) | ||
| 60 | |||
| 61 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | ||
| 62 | #define __HAVE_BUILTIN_BSWAP32__ | ||
| 63 | #define __HAVE_BUILTIN_BSWAP64__ | ||
| 64 | #define __HAVE_BUILTIN_BSWAP16__ | ||
| 65 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | ||
| 66 | |||
| 67 | #define KASAN_ABI_VERSION 4 | ||
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index 0c9a2f2c2802..d4c71132d07f 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h | |||
| @@ -13,10 +13,12 @@ | |||
| 13 | /* Intel ECC compiler doesn't support gcc specific asm stmts. | 13 | /* Intel ECC compiler doesn't support gcc specific asm stmts. |
| 14 | * It uses intrinsics to do the equivalent things. | 14 | * It uses intrinsics to do the equivalent things. |
| 15 | */ | 15 | */ |
| 16 | #undef barrier | ||
| 16 | #undef barrier_data | 17 | #undef barrier_data |
| 17 | #undef RELOC_HIDE | 18 | #undef RELOC_HIDE |
| 18 | #undef OPTIMIZER_HIDE_VAR | 19 | #undef OPTIMIZER_HIDE_VAR |
| 19 | 20 | ||
| 21 | #define barrier() __memory_barrier() | ||
| 20 | #define barrier_data(ptr) barrier() | 22 | #define barrier_data(ptr) barrier() |
| 21 | 23 | ||
| 22 | #define RELOC_HIDE(ptr, off) \ | 24 | #define RELOC_HIDE(ptr, off) \ |
diff --git a/include/linux/console.h b/include/linux/console.h index 9f50fb413c11..bd194343c346 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -115,6 +115,7 @@ static inline int con_debug_leave(void) | |||
| 115 | #define CON_BOOT (8) | 115 | #define CON_BOOT (8) |
| 116 | #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ | 116 | #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ |
| 117 | #define CON_BRL (32) /* Used for a braille device */ | 117 | #define CON_BRL (32) /* Used for a braille device */ |
| 118 | #define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */ | ||
| 118 | 119 | ||
| 119 | struct console { | 120 | struct console { |
| 120 | char name[16]; | 121 | char name[16]; |
diff --git a/include/linux/printk.h b/include/linux/printk.h index 9b30871c9149..58b1fec40d37 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
| @@ -30,6 +30,8 @@ static inline const char *printk_skip_level(const char *buffer) | |||
| 30 | return buffer; | 30 | return buffer; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | #define CONSOLE_EXT_LOG_MAX 8192 | ||
| 34 | |||
| 33 | /* printk's without a loglevel use this.. */ | 35 | /* printk's without a loglevel use this.. */ |
| 34 | #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT | 36 | #define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT |
| 35 | 37 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6633e83e608a..93ed0b682adb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -2556,8 +2556,22 @@ extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); | |||
| 2556 | /* Remove the current tasks stale references to the old mm_struct */ | 2556 | /* Remove the current tasks stale references to the old mm_struct */ |
| 2557 | extern void mm_release(struct task_struct *, struct mm_struct *); | 2557 | extern void mm_release(struct task_struct *, struct mm_struct *); |
| 2558 | 2558 | ||
| 2559 | #ifdef CONFIG_HAVE_COPY_THREAD_TLS | ||
| 2560 | extern int copy_thread_tls(unsigned long, unsigned long, unsigned long, | ||
| 2561 | struct task_struct *, unsigned long); | ||
| 2562 | #else | ||
| 2559 | extern int copy_thread(unsigned long, unsigned long, unsigned long, | 2563 | extern int copy_thread(unsigned long, unsigned long, unsigned long, |
| 2560 | struct task_struct *); | 2564 | struct task_struct *); |
| 2565 | |||
| 2566 | /* Architectures that haven't opted into copy_thread_tls get the tls argument | ||
| 2567 | * via pt_regs, so ignore the tls argument passed via C. */ | ||
| 2568 | static inline int copy_thread_tls( | ||
| 2569 | unsigned long clone_flags, unsigned long sp, unsigned long arg, | ||
| 2570 | struct task_struct *p, unsigned long tls) | ||
| 2571 | { | ||
| 2572 | return copy_thread(clone_flags, sp, arg, p); | ||
| 2573 | } | ||
| 2574 | #endif | ||
| 2561 | extern void flush_thread(void); | 2575 | extern void flush_thread(void); |
| 2562 | extern void exit_thread(void); | 2576 | extern void exit_thread(void); |
| 2563 | 2577 | ||
| @@ -2576,6 +2590,7 @@ extern int do_execveat(int, struct filename *, | |||
| 2576 | const char __user * const __user *, | 2590 | const char __user * const __user *, |
| 2577 | const char __user * const __user *, | 2591 | const char __user * const __user *, |
| 2578 | int); | 2592 | int); |
| 2593 | extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *, unsigned long); | ||
| 2579 | extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); | 2594 | extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); |
| 2580 | struct task_struct *fork_idle(int); | 2595 | struct task_struct *fork_idle(int); |
| 2581 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 2596 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
diff --git a/include/linux/stddef.h b/include/linux/stddef.h index 076af437284d..9c61c7cda936 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/stddef.h> | 4 | #include <uapi/linux/stddef.h> |
| 5 | 5 | ||
| 6 | |||
| 7 | #undef NULL | 6 | #undef NULL |
| 8 | #define NULL ((void *)0) | 7 | #define NULL ((void *)0) |
| 9 | 8 | ||
| @@ -14,10 +13,9 @@ enum { | |||
| 14 | 13 | ||
| 15 | #undef offsetof | 14 | #undef offsetof |
| 16 | #ifdef __compiler_offsetof | 15 | #ifdef __compiler_offsetof |
| 17 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) | 16 | #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER) |
| 18 | #else | 17 | #else |
| 19 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | 18 | #define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) |
| 20 | #endif | ||
| 21 | #endif | 19 | #endif |
| 22 | 20 | ||
| 23 | /** | 21 | /** |
| @@ -28,3 +26,5 @@ enum { | |||
| 28 | */ | 26 | */ |
| 29 | #define offsetofend(TYPE, MEMBER) \ | 27 | #define offsetofend(TYPE, MEMBER) \ |
| 30 | (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER)) | 28 | (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER)) |
| 29 | |||
| 30 | #endif | ||
diff --git a/include/linux/string.h b/include/linux/string.h index e40099e585c9..a8d90db9c4b0 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -111,6 +111,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t); | |||
| 111 | extern void * memchr(const void *,int,__kernel_size_t); | 111 | extern void * memchr(const void *,int,__kernel_size_t); |
| 112 | #endif | 112 | #endif |
| 113 | void *memchr_inv(const void *s, int c, size_t n); | 113 | void *memchr_inv(const void *s, int c, size_t n); |
| 114 | char *strreplace(char *s, char old, char new); | ||
| 114 | 115 | ||
| 115 | extern void kfree_const(const void *x); | 116 | extern void kfree_const(const void *x); |
| 116 | 117 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 76d1e38aabe1..bb51becf23f8 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -827,15 +827,15 @@ asmlinkage long sys_syncfs(int fd); | |||
| 827 | asmlinkage long sys_fork(void); | 827 | asmlinkage long sys_fork(void); |
| 828 | asmlinkage long sys_vfork(void); | 828 | asmlinkage long sys_vfork(void); |
| 829 | #ifdef CONFIG_CLONE_BACKWARDS | 829 | #ifdef CONFIG_CLONE_BACKWARDS |
| 830 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, int, | 830 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, unsigned long, |
| 831 | int __user *); | 831 | int __user *); |
| 832 | #else | 832 | #else |
| 833 | #ifdef CONFIG_CLONE_BACKWARDS3 | 833 | #ifdef CONFIG_CLONE_BACKWARDS3 |
| 834 | asmlinkage long sys_clone(unsigned long, unsigned long, int, int __user *, | 834 | asmlinkage long sys_clone(unsigned long, unsigned long, int, int __user *, |
| 835 | int __user *, int); | 835 | int __user *, unsigned long); |
| 836 | #else | 836 | #else |
| 837 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, | 837 | asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, |
| 838 | int __user *, int); | 838 | int __user *, unsigned long); |
| 839 | #endif | 839 | #endif |
| 840 | #endif | 840 | #endif |
| 841 | 841 | ||
diff --git a/include/linux/syslog.h b/include/linux/syslog.h index 4b7b875a7ce1..c3a7f0cc3a27 100644 --- a/include/linux/syslog.h +++ b/include/linux/syslog.h | |||
| @@ -47,12 +47,12 @@ | |||
| 47 | #define SYSLOG_FROM_READER 0 | 47 | #define SYSLOG_FROM_READER 0 |
| 48 | #define SYSLOG_FROM_PROC 1 | 48 | #define SYSLOG_FROM_PROC 1 |
| 49 | 49 | ||
| 50 | int do_syslog(int type, char __user *buf, int count, bool from_file); | 50 | int do_syslog(int type, char __user *buf, int count, int source); |
| 51 | 51 | ||
| 52 | #ifdef CONFIG_PRINTK | 52 | #ifdef CONFIG_PRINTK |
| 53 | int check_syslog_permissions(int type, bool from_file); | 53 | int check_syslog_permissions(int type, int source); |
| 54 | #else | 54 | #else |
| 55 | static inline int check_syslog_permissions(int type, bool from_file) | 55 | static inline int check_syslog_permissions(int type, int source) |
| 56 | { | 56 | { |
| 57 | return 0; | 57 | return 0; |
| 58 | } | 58 | } |
diff --git a/include/linux/zpool.h b/include/linux/zpool.h index 56529b34dc63..d30eff3d84d5 100644 --- a/include/linux/zpool.h +++ b/include/linux/zpool.h | |||
| @@ -81,7 +81,8 @@ struct zpool_driver { | |||
| 81 | atomic_t refcount; | 81 | atomic_t refcount; |
| 82 | struct list_head list; | 82 | struct list_head list; |
| 83 | 83 | ||
| 84 | void *(*create)(char *name, gfp_t gfp, struct zpool_ops *ops); | 84 | void *(*create)(char *name, gfp_t gfp, struct zpool_ops *ops, |
| 85 | struct zpool *zpool); | ||
| 85 | void (*destroy)(void *pool); | 86 | void (*destroy)(void *pool); |
| 86 | 87 | ||
| 87 | int (*malloc)(void *pool, size_t size, gfp_t gfp, | 88 | int (*malloc)(void *pool, size_t size, gfp_t gfp, |
| @@ -102,6 +103,4 @@ void zpool_register_driver(struct zpool_driver *driver); | |||
| 102 | 103 | ||
| 103 | int zpool_unregister_driver(struct zpool_driver *driver); | 104 | int zpool_unregister_driver(struct zpool_driver *driver); |
| 104 | 105 | ||
| 105 | int zpool_evict(void *pool, unsigned long handle); | ||
| 106 | |||
| 107 | #endif | 106 | #endif |
