diff options
Diffstat (limited to 'include/linux/percpu-defs.h')
-rw-r--r-- | include/linux/percpu-defs.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 0fa0cb524250..1fa36eb54b6a 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -19,6 +19,16 @@ | |||
19 | __attribute__((section(".discard"), unused)) | 19 | __attribute__((section(".discard"), unused)) |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * Macro which verifies @ptr is a percpu pointer without evaluating | ||
23 | * @ptr. This is to be used in percpu accessors to verify that the | ||
24 | * input parameter is a percpu pointer. | ||
25 | */ | ||
26 | #define __verify_pcpu_ptr(ptr) do { \ | ||
27 | void __percpu *__vpp_verify = (typeof(ptr))NULL; \ | ||
28 | (void)__vpp_verify; \ | ||
29 | } while (0) | ||
30 | |||
31 | /* | ||
22 | * s390 and alpha modules require percpu variables to be defined as | 32 | * s390 and alpha modules require percpu variables to be defined as |
23 | * weak to force the compiler to generate GOT based external | 33 | * weak to force the compiler to generate GOT based external |
24 | * references for them. This is necessary because percpu sections | 34 | * references for them. This is necessary because percpu sections |
@@ -129,10 +139,16 @@ | |||
129 | __aligned(PAGE_SIZE) | 139 | __aligned(PAGE_SIZE) |
130 | 140 | ||
131 | /* | 141 | /* |
132 | * Intermodule exports for per-CPU variables. | 142 | * Intermodule exports for per-CPU variables. sparse forgets about |
143 | * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to | ||
144 | * noop if __CHECKER__. | ||
133 | */ | 145 | */ |
146 | #ifndef __CHECKER__ | ||
134 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var) | 147 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var) |
135 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var) | 148 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var) |
136 | 149 | #else | |
150 | #define EXPORT_PER_CPU_SYMBOL(var) | ||
151 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) | ||
152 | #endif | ||
137 | 153 | ||
138 | #endif /* _LINUX_PERCPU_DEFS_H */ | 154 | #endif /* _LINUX_PERCPU_DEFS_H */ |