aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 09:43:54 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 10:06:11 -0400
commit7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch)
tree5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /include/linux/module.h
parent7d754596756240fa918b94cd0c3011c77a638987 (diff)
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
Merge 'Linux v3.0' into Litmus
Some notes: * Litmus^RT scheduling class is the topmost scheduling class (above stop_sched_class). * scheduler_ipi() function (e.g., in smp_reschedule_interrupt()) may increase IPI latencies. * Added path into schedule() to quickly re-evaluate scheduling decision without becoming preemptive again. This used to be a standard path before the removal of BKL. Conflicts: Makefile arch/arm/kernel/calls.S arch/arm/kernel/smp.c arch/x86/include/asm/unistd_32.h arch/x86/kernel/smp.c arch/x86/kernel/syscall_table_32.S include/linux/hrtimer.h kernel/printk.c kernel/sched.c kernel/sched_fair.c
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h70
1 files changed, 56 insertions, 14 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index aace066bad8f..d9ca2d5dc6d0 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -58,6 +58,15 @@ struct module_attribute {
58 void (*free)(struct module *); 58 void (*free)(struct module *);
59}; 59};
60 60
61struct module_version_attribute {
62 struct module_attribute mattr;
63 const char *module_name;
64 const char *version;
65} __attribute__ ((__aligned__(sizeof(void *))));
66
67extern ssize_t __modver_version_show(struct module_attribute *,
68 struct module *, char *);
69
61struct module_kobject 70struct module_kobject
62{ 71{
63 struct kobject kobj; 72 struct kobject kobj;
@@ -161,7 +170,26 @@ extern struct module __this_module;
161 Using this automatically adds a checksum of the .c files and the 170 Using this automatically adds a checksum of the .c files and the
162 local headers in "srcversion". 171 local headers in "srcversion".
163*/ 172*/
173
174#if defined(MODULE) || !defined(CONFIG_SYSFS)
164#define MODULE_VERSION(_version) MODULE_INFO(version, _version) 175#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
176#else
177#define MODULE_VERSION(_version) \
178 static struct module_version_attribute ___modver_attr = { \
179 .mattr = { \
180 .attr = { \
181 .name = "version", \
182 .mode = S_IRUGO, \
183 }, \
184 .show = __modver_version_show, \
185 }, \
186 .module_name = KBUILD_MODNAME, \
187 .version = _version, \
188 }; \
189 static const struct module_version_attribute \
190 __used __attribute__ ((__section__ ("__modver"))) \
191 * __moduleparam_const __modver_attr = &___modver_attr
192#endif
165 193
166/* Optional firmware file (or files) needed by the module 194/* Optional firmware file (or files) needed by the module
167 * format is simply firmware file name. Multiple firmware 195 * format is simply firmware file name. Multiple firmware
@@ -196,7 +224,7 @@ struct module_use {
196 extern void *__crc_##sym __attribute__((weak)); \ 224 extern void *__crc_##sym __attribute__((weak)); \
197 static const unsigned long __kcrctab_##sym \ 225 static const unsigned long __kcrctab_##sym \
198 __used \ 226 __used \
199 __attribute__((section("__kcrctab" sec), unused)) \ 227 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
200 = (unsigned long) &__crc_##sym; 228 = (unsigned long) &__crc_##sym;
201#else 229#else
202#define __CRC_SYMBOL(sym, sec) 230#define __CRC_SYMBOL(sym, sec)
@@ -211,7 +239,7 @@ struct module_use {
211 = MODULE_SYMBOL_PREFIX #sym; \ 239 = MODULE_SYMBOL_PREFIX #sym; \
212 static const struct kernel_symbol __ksymtab_##sym \ 240 static const struct kernel_symbol __ksymtab_##sym \
213 __used \ 241 __used \
214 __attribute__((section("__ksymtab" sec), unused)) \ 242 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
215 = { (unsigned long)&sym, __kstrtab_##sym } 243 = { (unsigned long)&sym, __kstrtab_##sym }
216 244
217#define EXPORT_SYMBOL(sym) \ 245#define EXPORT_SYMBOL(sym) \
@@ -308,6 +336,9 @@ struct module
308 /* The size of the executable code in each section. */ 336 /* The size of the executable code in each section. */
309 unsigned int init_text_size, core_text_size; 337 unsigned int init_text_size, core_text_size;
310 338
339 /* Size of RO sections of the module (text+rodata) */
340 unsigned int init_ro_size, core_ro_size;
341
311 /* Arch-specific module values */ 342 /* Arch-specific module values */
312 struct mod_arch_specific arch; 343 struct mod_arch_specific arch;
313 344
@@ -337,31 +368,35 @@ struct module
337 struct module_notes_attrs *notes_attrs; 368 struct module_notes_attrs *notes_attrs;
338#endif 369#endif
339 370
371 /* The command line arguments (may be mangled). People like
372 keeping pointers to this stuff */
373 char *args;
374
340#ifdef CONFIG_SMP 375#ifdef CONFIG_SMP
341 /* Per-cpu data. */ 376 /* Per-cpu data. */
342 void __percpu *percpu; 377 void __percpu *percpu;
343 unsigned int percpu_size; 378 unsigned int percpu_size;
344#endif 379#endif
345 380
346 /* The command line arguments (may be mangled). People like
347 keeping pointers to this stuff */
348 char *args;
349#ifdef CONFIG_TRACEPOINTS 381#ifdef CONFIG_TRACEPOINTS
350 struct tracepoint *tracepoints;
351 unsigned int num_tracepoints; 382 unsigned int num_tracepoints;
383 struct tracepoint * const *tracepoints_ptrs;
384#endif
385#ifdef HAVE_JUMP_LABEL
386 struct jump_entry *jump_entries;
387 unsigned int num_jump_entries;
352#endif 388#endif
353
354#ifdef CONFIG_TRACING 389#ifdef CONFIG_TRACING
355 const char **trace_bprintk_fmt_start;
356 unsigned int num_trace_bprintk_fmt; 390 unsigned int num_trace_bprintk_fmt;
391 const char **trace_bprintk_fmt_start;
357#endif 392#endif
358#ifdef CONFIG_EVENT_TRACING 393#ifdef CONFIG_EVENT_TRACING
359 struct ftrace_event_call *trace_events; 394 struct ftrace_event_call **trace_events;
360 unsigned int num_trace_events; 395 unsigned int num_trace_events;
361#endif 396#endif
362#ifdef CONFIG_FTRACE_MCOUNT_RECORD 397#ifdef CONFIG_FTRACE_MCOUNT_RECORD
363 unsigned long *ftrace_callsites;
364 unsigned int num_ftrace_callsites; 398 unsigned int num_ftrace_callsites;
399 unsigned long *ftrace_callsites;
365#endif 400#endif
366 401
367#ifdef CONFIG_MODULE_UNLOAD 402#ifdef CONFIG_MODULE_UNLOAD
@@ -442,8 +477,9 @@ const struct kernel_symbol *find_symbol(const char *name,
442 bool warn); 477 bool warn);
443 478
444/* Walk the exported symbol table */ 479/* Walk the exported symbol table */
445bool each_symbol(bool (*fn)(const struct symsearch *arr, struct module *owner, 480bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
446 unsigned int symnum, void *data), void *data); 481 struct module *owner,
482 void *data), void *data);
447 483
448/* 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
449 symnum out of range. */ 485 symnum out of range. */
@@ -514,7 +550,7 @@ static inline void __module_get(struct module *module)
514#define symbol_put_addr(p) do { } while(0) 550#define symbol_put_addr(p) do { } while(0)
515 551
516#endif /* CONFIG_MODULE_UNLOAD */ 552#endif /* CONFIG_MODULE_UNLOAD */
517int use_module(struct module *a, struct module *b); 553int ref_module(struct module *a, struct module *b);
518 554
519/* This is a #define so the string doesn't get put in every .o file */ 555/* This is a #define so the string doesn't get put in every .o file */
520#define module_name(mod) \ 556#define module_name(mod) \
@@ -669,7 +705,6 @@ static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter)
669{ 705{
670 return 0; 706 return 0;
671} 707}
672
673#endif /* CONFIG_MODULES */ 708#endif /* CONFIG_MODULES */
674 709
675#ifdef CONFIG_SYSFS 710#ifdef CONFIG_SYSFS
@@ -684,6 +719,13 @@ extern int module_sysfs_initialized;
684 719
685#define __MODULE_STRING(x) __stringify(x) 720#define __MODULE_STRING(x) __stringify(x)
686 721
722#ifdef CONFIG_DEBUG_SET_MODULE_RONX
723extern void set_all_modules_text_rw(void);
724extern void set_all_modules_text_ro(void);
725#else
726static inline void set_all_modules_text_rw(void) { }
727static inline void set_all_modules_text_ro(void) { }
728#endif
687 729
688#ifdef CONFIG_GENERIC_BUG 730#ifdef CONFIG_GENERIC_BUG
689void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, 731void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,