aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h37
1 files changed, 20 insertions, 17 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 5de42043dff0..d9ca2d5dc6d0 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -64,6 +64,9 @@ struct module_version_attribute {
64 const char *version; 64 const char *version;
65} __attribute__ ((__aligned__(sizeof(void *)))); 65} __attribute__ ((__aligned__(sizeof(void *))));
66 66
67extern ssize_t __modver_version_show(struct module_attribute *,
68 struct module *, char *);
69
67struct module_kobject 70struct module_kobject
68{ 71{
69 struct kobject kobj; 72 struct kobject kobj;
@@ -172,12 +175,7 @@ extern struct module __this_module;
172#define MODULE_VERSION(_version) MODULE_INFO(version, _version) 175#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
173#else 176#else
174#define MODULE_VERSION(_version) \ 177#define MODULE_VERSION(_version) \
175 extern ssize_t __modver_version_show(struct module_attribute *, \ 178 static struct module_version_attribute ___modver_attr = { \
176 struct module *, char *); \
177 static struct module_version_attribute __modver_version_attr \
178 __used \
179 __attribute__ ((__section__ ("__modver"),aligned(sizeof(void *)))) \
180 = { \
181 .mattr = { \ 179 .mattr = { \
182 .attr = { \ 180 .attr = { \
183 .name = "version", \ 181 .name = "version", \
@@ -187,7 +185,10 @@ extern struct module __this_module;
187 }, \ 185 }, \
188 .module_name = KBUILD_MODNAME, \ 186 .module_name = KBUILD_MODNAME, \
189 .version = _version, \ 187 .version = _version, \
190 } 188 }; \
189 static const struct module_version_attribute \
190 __used __attribute__ ((__section__ ("__modver"))) \
191 * __moduleparam_const __modver_attr = &___modver_attr
191#endif 192#endif
192 193
193/* Optional firmware file (or files) needed by the module 194/* Optional firmware file (or files) needed by the module
@@ -223,7 +224,7 @@ struct module_use {
223 extern void *__crc_##sym __attribute__((weak)); \ 224 extern void *__crc_##sym __attribute__((weak)); \
224 static const unsigned long __kcrctab_##sym \ 225 static const unsigned long __kcrctab_##sym \
225 __used \ 226 __used \
226 __attribute__((section("__kcrctab" sec), unused)) \ 227 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
227 = (unsigned long) &__crc_##sym; 228 = (unsigned long) &__crc_##sym;
228#else 229#else
229#define __CRC_SYMBOL(sym, sec) 230#define __CRC_SYMBOL(sym, sec)
@@ -238,7 +239,7 @@ struct module_use {
238 = MODULE_SYMBOL_PREFIX #sym; \ 239 = MODULE_SYMBOL_PREFIX #sym; \
239 static const struct kernel_symbol __ksymtab_##sym \ 240 static const struct kernel_symbol __ksymtab_##sym \
240 __used \ 241 __used \
241 __attribute__((section("__ksymtab" sec), unused)) \ 242 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
242 = { (unsigned long)&sym, __kstrtab_##sym } 243 = { (unsigned long)&sym, __kstrtab_##sym }
243 244
244#define EXPORT_SYMBOL(sym) \ 245#define EXPORT_SYMBOL(sym) \
@@ -367,34 +368,35 @@ struct module
367 struct module_notes_attrs *notes_attrs; 368 struct module_notes_attrs *notes_attrs;
368#endif 369#endif
369 370
371 /* The command line arguments (may be mangled). People like
372 keeping pointers to this stuff */
373 char *args;
374
370#ifdef CONFIG_SMP 375#ifdef CONFIG_SMP
371 /* Per-cpu data. */ 376 /* Per-cpu data. */
372 void __percpu *percpu; 377 void __percpu *percpu;
373 unsigned int percpu_size; 378 unsigned int percpu_size;
374#endif 379#endif
375 380
376 /* The command line arguments (may be mangled). People like
377 keeping pointers to this stuff */
378 char *args;
379#ifdef CONFIG_TRACEPOINTS 381#ifdef CONFIG_TRACEPOINTS
380 struct tracepoint * const *tracepoints_ptrs;
381 unsigned int num_tracepoints; 382 unsigned int num_tracepoints;
383 struct tracepoint * const *tracepoints_ptrs;
382#endif 384#endif
383#ifdef HAVE_JUMP_LABEL 385#ifdef HAVE_JUMP_LABEL
384 struct jump_entry *jump_entries; 386 struct jump_entry *jump_entries;
385 unsigned int num_jump_entries; 387 unsigned int num_jump_entries;
386#endif 388#endif
387#ifdef CONFIG_TRACING 389#ifdef CONFIG_TRACING
388 const char **trace_bprintk_fmt_start;
389 unsigned int num_trace_bprintk_fmt; 390 unsigned int num_trace_bprintk_fmt;
391 const char **trace_bprintk_fmt_start;
390#endif 392#endif
391#ifdef CONFIG_EVENT_TRACING 393#ifdef CONFIG_EVENT_TRACING
392 struct ftrace_event_call **trace_events; 394 struct ftrace_event_call **trace_events;
393 unsigned int num_trace_events; 395 unsigned int num_trace_events;
394#endif 396#endif
395#ifdef CONFIG_FTRACE_MCOUNT_RECORD 397#ifdef CONFIG_FTRACE_MCOUNT_RECORD
396 unsigned long *ftrace_callsites;
397 unsigned int num_ftrace_callsites; 398 unsigned int num_ftrace_callsites;
399 unsigned long *ftrace_callsites;
398#endif 400#endif
399 401
400#ifdef CONFIG_MODULE_UNLOAD 402#ifdef CONFIG_MODULE_UNLOAD
@@ -475,8 +477,9 @@ const struct kernel_symbol *find_symbol(const char *name,
475 bool warn); 477 bool warn);
476 478
477/* Walk the exported symbol table */ 479/* Walk the exported symbol table */
478bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner, 480bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
479 unsigned int symnum, void *data), void *data); 481 struct module *owner,
482 void *data), void *data);
480 483
481/* Returns 0 and fills in value, defined and namebuf, or -ERANGE if 484/* Returns 0 and fills in value, defined and namebuf, or -ERANGE if
482 symnum out of range. */ 485 symnum out of range. */