diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/module.h | 11 | ||||
-rw-r--r-- | include/linux/percpu.h | 7 |
2 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index 5e869ffd34aa..8bd399a00343 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -330,8 +330,11 @@ struct module | |||
330 | struct module_notes_attrs *notes_attrs; | 330 | struct module_notes_attrs *notes_attrs; |
331 | #endif | 331 | #endif |
332 | 332 | ||
333 | #ifdef CONFIG_SMP | ||
333 | /* Per-cpu data. */ | 334 | /* Per-cpu data. */ |
334 | void *percpu; | 335 | void __percpu *percpu; |
336 | unsigned int percpu_size; | ||
337 | #endif | ||
335 | 338 | ||
336 | /* The command line arguments (may be mangled). People like | 339 | /* The command line arguments (may be mangled). People like |
337 | keeping pointers to this stuff */ | 340 | keeping pointers to this stuff */ |
@@ -392,6 +395,7 @@ static inline int module_is_live(struct module *mod) | |||
392 | struct module *__module_text_address(unsigned long addr); | 395 | struct module *__module_text_address(unsigned long addr); |
393 | struct module *__module_address(unsigned long addr); | 396 | struct module *__module_address(unsigned long addr); |
394 | bool is_module_address(unsigned long addr); | 397 | bool is_module_address(unsigned long addr); |
398 | bool is_module_percpu_address(unsigned long addr); | ||
395 | bool is_module_text_address(unsigned long addr); | 399 | bool is_module_text_address(unsigned long addr); |
396 | 400 | ||
397 | static inline int within_module_core(unsigned long addr, struct module *mod) | 401 | static inline int within_module_core(unsigned long addr, struct module *mod) |
@@ -563,6 +567,11 @@ static inline bool is_module_address(unsigned long addr) | |||
563 | return false; | 567 | return false; |
564 | } | 568 | } |
565 | 569 | ||
570 | static inline bool is_module_percpu_address(unsigned long addr) | ||
571 | { | ||
572 | return false; | ||
573 | } | ||
574 | |||
566 | static inline bool is_module_text_address(unsigned long addr) | 575 | static inline bool is_module_text_address(unsigned long addr) |
567 | { | 576 | { |
568 | return false; | 577 | return false; |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index c7845130bfdf..d3a38d687104 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -135,6 +135,7 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size, | |||
135 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) | 135 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) |
136 | 136 | ||
137 | extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); | 137 | extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); |
138 | extern bool is_kernel_percpu_address(unsigned long addr); | ||
138 | 139 | ||
139 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 140 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
140 | extern void __init setup_per_cpu_areas(void); | 141 | extern void __init setup_per_cpu_areas(void); |
@@ -144,6 +145,12 @@ extern void __init setup_per_cpu_areas(void); | |||
144 | 145 | ||
145 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) | 146 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) |
146 | 147 | ||
148 | /* can't distinguish from other static vars, always false */ | ||
149 | static inline bool is_kernel_percpu_address(unsigned long addr) | ||
150 | { | ||
151 | return false; | ||
152 | } | ||
153 | |||
147 | static inline void __init setup_per_cpu_areas(void) { } | 154 | static inline void __init setup_per_cpu_areas(void) { } |
148 | 155 | ||
149 | static inline void *pcpu_lpage_remapped(void *kaddr) | 156 | static inline void *pcpu_lpage_remapped(void *kaddr) |