Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
[pandora-kernel.git] / include / linux / module.h
1 #ifndef _LINUX_MODULE_H
2 #define _LINUX_MODULE_H
3 /*
4  * Dynamic loading of modules into the kernel.
5  *
6  * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
7  * Rewritten again by Rusty Russell, 2002
8  */
9 #include <linux/list.h>
10 #include <linux/stat.h>
11 #include <linux/compiler.h>
12 #include <linux/cache.h>
13 #include <linux/kmod.h>
14 #include <linux/elf.h>
15 #include <linux/stringify.h>
16 #include <linux/kobject.h>
17 #include <linux/moduleparam.h>
18 #include <linux/tracepoint.h>
19
20 #include <linux/percpu.h>
21 #include <asm/module.h>
22
23 #include <trace/events/module.h>
24
25 /* Not Yet Implemented */
26 #define MODULE_SUPPORTED_DEVICE(name)
27
28 /* Some toolchains use a `_' prefix for all user symbols. */
29 #ifdef CONFIG_SYMBOL_PREFIX
30 #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
31 #else
32 #define MODULE_SYMBOL_PREFIX ""
33 #endif
34
35 #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
36
37 struct kernel_symbol
38 {
39         unsigned long value;
40         const char *name;
41 };
42
43 struct modversion_info
44 {
45         unsigned long crc;
46         char name[MODULE_NAME_LEN];
47 };
48
49 struct module;
50
51 struct module_kobject {
52         struct kobject kobj;
53         struct module *mod;
54         struct kobject *drivers_dir;
55         struct module_param_attrs *mp;
56 };
57
58 struct module_attribute {
59         struct attribute attr;
60         ssize_t (*show)(struct module_attribute *, struct module_kobject *,
61                         char *);
62         ssize_t (*store)(struct module_attribute *, struct module_kobject *,
63                          const char *, size_t count);
64         void (*setup)(struct module *, const char *);
65         int (*test)(struct module *);
66         void (*free)(struct module *);
67 };
68
69 struct module_version_attribute {
70         struct module_attribute mattr;
71         const char *module_name;
72         const char *version;
73 } __attribute__ ((__aligned__(sizeof(void *))));
74
75 extern ssize_t __modver_version_show(struct module_attribute *,
76                                      struct module_kobject *, char *);
77
78 extern struct module_attribute module_uevent;
79
80 /* These are either module local, or the kernel's dummy ones. */
81 extern int init_module(void);
82 extern void cleanup_module(void);
83
84 /* Archs provide a method of finding the correct exception table. */
85 struct exception_table_entry;
86
87 const struct exception_table_entry *
88 search_extable(const struct exception_table_entry *first,
89                const struct exception_table_entry *last,
90                unsigned long value);
91 void sort_extable(struct exception_table_entry *start,
92                   struct exception_table_entry *finish);
93 void sort_main_extable(void);
94 void trim_init_extable(struct module *m);
95
96 #ifdef MODULE
97 #define MODULE_GENERIC_TABLE(gtype,name)                        \
98 extern const struct gtype##_id __mod_##gtype##_table            \
99   __attribute__ ((unused, alias(__stringify(name))))
100
101 extern struct module __this_module;
102 #define THIS_MODULE (&__this_module)
103 #else  /* !MODULE */
104 #define MODULE_GENERIC_TABLE(gtype,name)
105 #define THIS_MODULE ((struct module *)0)
106 #endif
107
108 /* Generic info of form tag = "info" */
109 #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
110
111 /* For userspace: you can also call me... */
112 #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
113
114 /*
115  * The following license idents are currently accepted as indicating free
116  * software modules
117  *
118  *      "GPL"                           [GNU Public License v2 or later]
119  *      "GPL v2"                        [GNU Public License v2]
120  *      "GPL and additional rights"     [GNU Public License v2 rights and more]
121  *      "Dual BSD/GPL"                  [GNU Public License v2
122  *                                       or BSD license choice]
123  *      "Dual MIT/GPL"                  [GNU Public License v2
124  *                                       or MIT license choice]
125  *      "Dual MPL/GPL"                  [GNU Public License v2
126  *                                       or Mozilla license choice]
127  *
128  * The following other idents are available
129  *
130  *      "Proprietary"                   [Non free products]
131  *
132  * There are dual licensed components, but when running with Linux it is the
133  * GPL that is relevant so this is a non issue. Similarly LGPL linked with GPL
134  * is a GPL combined work.
135  *
136  * This exists for several reasons
137  * 1.   So modinfo can show license info for users wanting to vet their setup 
138  *      is free
139  * 2.   So the community can ignore bug reports including proprietary modules
140  * 3.   So vendors can do likewise based on their own policies
141  */
142 #define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
143
144 /*
145  * Author(s), use "Name <email>" or just "Name", for multiple
146  * authors use multiple MODULE_AUTHOR() statements/lines.
147  */
148 #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
149   
150 /* What your module does. */
151 #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
152
153 /* One for each parameter, describing how to use it.  Some files do
154    multiple of these per line, so can't just use MODULE_INFO. */
155 #define MODULE_PARM_DESC(_parm, desc) \
156         __MODULE_INFO(parm, _parm, #_parm ":" desc)
157
158 #define MODULE_DEVICE_TABLE(type,name)          \
159   MODULE_GENERIC_TABLE(type##_device,name)
160
161 /* Version of form [<epoch>:]<version>[-<extra-version>].
162    Or for CVS/RCS ID version, everything but the number is stripped.
163   <epoch>: A (small) unsigned integer which allows you to start versions
164            anew. If not mentioned, it's zero.  eg. "2:1.0" is after
165            "1:2.0".
166   <version>: The <version> may contain only alphanumerics and the
167            character `.'.  Ordered by numeric sort for numeric parts,
168            ascii sort for ascii parts (as per RPM or DEB algorithm).
169   <extraversion>: Like <version>, but inserted for local
170            customizations, eg "rh3" or "rusty1".
171
172   Using this automatically adds a checksum of the .c files and the
173   local headers in "srcversion".
174 */
175
176 #if defined(MODULE) || !defined(CONFIG_SYSFS)
177 #define MODULE_VERSION(_version) MODULE_INFO(version, _version)
178 #else
179 #define MODULE_VERSION(_version)                                        \
180         static struct module_version_attribute ___modver_attr = {       \
181                 .mattr  = {                                             \
182                         .attr   = {                                     \
183                                 .name   = "version",                    \
184                                 .mode   = S_IRUGO,                      \
185                         },                                              \
186                         .show   = __modver_version_show,                \
187                 },                                                      \
188                 .module_name    = KBUILD_MODNAME,                       \
189                 .version        = _version,                             \
190         };                                                              \
191         static const struct module_version_attribute                    \
192         __used __attribute__ ((__section__ ("__modver")))               \
193         * __moduleparam_const __modver_attr = &___modver_attr
194 #endif
195
196 /* Optional firmware file (or files) needed by the module
197  * format is simply firmware file name.  Multiple firmware
198  * files require multiple MODULE_FIRMWARE() specifiers */
199 #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
200
201 /* Given an address, look for it in the exception tables */
202 const struct exception_table_entry *search_exception_tables(unsigned long add);
203
204 struct notifier_block;
205
206 #ifdef CONFIG_MODULES
207
208 extern int modules_disabled; /* for sysctl */
209 /* Get/put a kernel symbol (calls must be symmetric) */
210 void *__symbol_get(const char *symbol);
211 void *__symbol_get_gpl(const char *symbol);
212 #define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x)))
213
214 /* modules using other modules: kdb wants to see this. */
215 struct module_use {
216         struct list_head source_list;
217         struct list_head target_list;
218         struct module *source, *target;
219 };
220
221 #ifndef __GENKSYMS__
222 #ifdef CONFIG_MODVERSIONS
223 /* Mark the CRC weak since genksyms apparently decides not to
224  * generate a checksums for some symbols */
225 #define __CRC_SYMBOL(sym, sec)                                  \
226         extern void *__crc_##sym __attribute__((weak));         \
227         static const unsigned long __kcrctab_##sym              \
228         __used                                                  \
229         __attribute__((section("___kcrctab" sec "+" #sym), unused))     \
230         = (unsigned long) &__crc_##sym;
231 #else
232 #define __CRC_SYMBOL(sym, sec)
233 #endif
234
235 /* For every exported symbol, place a struct in the __ksymtab section */
236 #define __EXPORT_SYMBOL(sym, sec)                               \
237         extern typeof(sym) sym;                                 \
238         __CRC_SYMBOL(sym, sec)                                  \
239         static const char __kstrtab_##sym[]                     \
240         __attribute__((section("__ksymtab_strings"), aligned(1))) \
241         = MODULE_SYMBOL_PREFIX #sym;                            \
242         static const struct kernel_symbol __ksymtab_##sym       \
243         __used                                                  \
244         __attribute__((section("___ksymtab" sec "+" #sym), unused))     \
245         = { (unsigned long)&sym, __kstrtab_##sym }
246
247 #define EXPORT_SYMBOL(sym)                                      \
248         __EXPORT_SYMBOL(sym, "")
249
250 #define EXPORT_SYMBOL_GPL(sym)                                  \
251         __EXPORT_SYMBOL(sym, "_gpl")
252
253 #define EXPORT_SYMBOL_GPL_FUTURE(sym)                           \
254         __EXPORT_SYMBOL(sym, "_gpl_future")
255
256
257 #ifdef CONFIG_UNUSED_SYMBOLS
258 #define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
259 #define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
260 #else
261 #define EXPORT_UNUSED_SYMBOL(sym)
262 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
263 #endif
264
265 #endif
266
267 enum module_state
268 {
269         MODULE_STATE_LIVE,
270         MODULE_STATE_COMING,
271         MODULE_STATE_GOING,
272 };
273
274 struct module
275 {
276         enum module_state state;
277
278         /* Member of list of modules */
279         struct list_head list;
280
281         /* Unique handle for this module */
282         char name[MODULE_NAME_LEN];
283
284         /* Sysfs stuff. */
285         struct module_kobject mkobj;
286         struct module_attribute *modinfo_attrs;
287         const char *version;
288         const char *srcversion;
289         struct kobject *holders_dir;
290
291         /* Exported symbols */
292         const struct kernel_symbol *syms;
293         const unsigned long *crcs;
294         unsigned int num_syms;
295
296         /* Kernel parameters. */
297         struct kernel_param *kp;
298         unsigned int num_kp;
299
300         /* GPL-only exported symbols. */
301         unsigned int num_gpl_syms;
302         const struct kernel_symbol *gpl_syms;
303         const unsigned long *gpl_crcs;
304
305 #ifdef CONFIG_UNUSED_SYMBOLS
306         /* unused exported symbols. */
307         const struct kernel_symbol *unused_syms;
308         const unsigned long *unused_crcs;
309         unsigned int num_unused_syms;
310
311         /* GPL-only, unused exported symbols. */
312         unsigned int num_unused_gpl_syms;
313         const struct kernel_symbol *unused_gpl_syms;
314         const unsigned long *unused_gpl_crcs;
315 #endif
316
317         /* symbols that will be GPL-only in the near future. */
318         const struct kernel_symbol *gpl_future_syms;
319         const unsigned long *gpl_future_crcs;
320         unsigned int num_gpl_future_syms;
321
322         /* Exception table */
323         unsigned int num_exentries;
324         struct exception_table_entry *extable;
325
326         /* Startup function. */
327         int (*init)(void);
328
329         /* If this is non-NULL, vfree after init() returns */
330         void *module_init;
331
332         /* Here is the actual code + data, vfree'd on unload. */
333         void *module_core;
334
335         /* Here are the sizes of the init and core sections */
336         unsigned int init_size, core_size;
337
338         /* The size of the executable code in each section.  */
339         unsigned int init_text_size, core_text_size;
340
341         /* Size of RO sections of the module (text+rodata) */
342         unsigned int init_ro_size, core_ro_size;
343
344         /* Arch-specific module values */
345         struct mod_arch_specific arch;
346
347         unsigned int taints;    /* same bits as kernel:tainted */
348
349 #ifdef CONFIG_GENERIC_BUG
350         /* Support for BUG */
351         unsigned num_bugs;
352         struct list_head bug_list;
353         struct bug_entry *bug_table;
354 #endif
355
356 #ifdef CONFIG_KALLSYMS
357         /*
358          * We keep the symbol and string tables for kallsyms.
359          * The core_* fields below are temporary, loader-only (they
360          * could really be discarded after module init).
361          */
362         Elf_Sym *symtab, *core_symtab;
363         unsigned int num_symtab, core_num_syms;
364         char *strtab, *core_strtab;
365
366         /* Section attributes */
367         struct module_sect_attrs *sect_attrs;
368
369         /* Notes attributes */
370         struct module_notes_attrs *notes_attrs;
371 #endif
372
373         /* The command line arguments (may be mangled).  People like
374            keeping pointers to this stuff */
375         char *args;
376
377 #ifdef CONFIG_SMP
378         /* Per-cpu data. */
379         void __percpu *percpu;
380         unsigned int percpu_size;
381 #endif
382
383 #ifdef CONFIG_TRACEPOINTS
384         unsigned int num_tracepoints;
385         struct tracepoint * const *tracepoints_ptrs;
386 #endif
387 #ifdef HAVE_JUMP_LABEL
388         struct jump_entry *jump_entries;
389         unsigned int num_jump_entries;
390 #endif
391 #ifdef CONFIG_TRACING
392         unsigned int num_trace_bprintk_fmt;
393         const char **trace_bprintk_fmt_start;
394 #endif
395 #ifdef CONFIG_EVENT_TRACING
396         struct ftrace_event_call **trace_events;
397         unsigned int num_trace_events;
398 #endif
399 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
400         unsigned int num_ftrace_callsites;
401         unsigned long *ftrace_callsites;
402 #endif
403
404 #ifdef CONFIG_MODULE_UNLOAD
405         /* What modules depend on me? */
406         struct list_head source_list;
407         /* What modules do I depend on? */
408         struct list_head target_list;
409
410         /* Who is waiting for us to be unloaded */
411         struct task_struct *waiter;
412
413         /* Destruction function. */
414         void (*exit)(void);
415
416         struct module_ref {
417                 unsigned int incs;
418                 unsigned int decs;
419         } __percpu *refptr;
420 #endif
421
422 #ifdef CONFIG_CONSTRUCTORS
423         /* Constructor functions. */
424         ctor_fn_t *ctors;
425         unsigned int num_ctors;
426 #endif
427 };
428 #ifndef MODULE_ARCH_INIT
429 #define MODULE_ARCH_INIT {}
430 #endif
431
432 extern struct mutex module_mutex;
433
434 /* FIXME: It'd be nice to isolate modules during init, too, so they
435    aren't used before they (may) fail.  But presently too much code
436    (IDE & SCSI) require entry into the module during init.*/
437 static inline int module_is_live(struct module *mod)
438 {
439         return mod->state != MODULE_STATE_GOING;
440 }
441
442 struct module *__module_text_address(unsigned long addr);
443 struct module *__module_address(unsigned long addr);
444 bool is_module_address(unsigned long addr);
445 bool is_module_percpu_address(unsigned long addr);
446 bool is_module_text_address(unsigned long addr);
447
448 static inline int within_module_core(unsigned long addr, struct module *mod)
449 {
450         return (unsigned long)mod->module_core <= addr &&
451                addr < (unsigned long)mod->module_core + mod->core_size;
452 }
453
454 static inline int within_module_init(unsigned long addr, struct module *mod)
455 {
456         return (unsigned long)mod->module_init <= addr &&
457                addr < (unsigned long)mod->module_init + mod->init_size;
458 }
459
460 /* Search for module by name: must hold module_mutex. */
461 struct module *find_module(const char *name);
462
463 struct symsearch {
464         const struct kernel_symbol *start, *stop;
465         const unsigned long *crcs;
466         enum {
467                 NOT_GPL_ONLY,
468                 GPL_ONLY,
469                 WILL_BE_GPL_ONLY,
470         } licence;
471         bool unused;
472 };
473
474 /* Search for an exported symbol by name. */
475 const struct kernel_symbol *find_symbol(const char *name,
476                                         struct module **owner,
477                                         const unsigned long **crc,
478                                         bool gplok,
479                                         bool warn);
480
481 /* Walk the exported symbol table */
482 bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
483                                     struct module *owner,
484                                     void *data), void *data);
485
486 /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if
487    symnum out of range. */
488 int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
489                         char *name, char *module_name, int *exported);
490
491 /* Look for this name: can be of form module:name. */
492 unsigned long module_kallsyms_lookup_name(const char *name);
493
494 int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
495                                              struct module *, unsigned long),
496                                    void *data);
497
498 extern void __module_put_and_exit(struct module *mod, long code)
499         __attribute__((noreturn));
500 #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code);
501
502 #ifdef CONFIG_MODULE_UNLOAD
503 unsigned int module_refcount(struct module *mod);
504 void __symbol_put(const char *symbol);
505 #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
506 void symbol_put_addr(void *addr);
507
508 /* Sometimes we know we already have a refcount, and it's easier not
509    to handle the error case (which only happens with rmmod --wait). */
510 static inline void __module_get(struct module *module)
511 {
512         if (module) {
513                 preempt_disable();
514                 __this_cpu_inc(module->refptr->incs);
515                 trace_module_get(module, _THIS_IP_);
516                 preempt_enable();
517         }
518 }
519
520 static inline int try_module_get(struct module *module)
521 {
522         int ret = 1;
523
524         if (module) {
525                 preempt_disable();
526
527                 if (likely(module_is_live(module))) {
528                         __this_cpu_inc(module->refptr->incs);
529                         trace_module_get(module, _THIS_IP_);
530                 } else
531                         ret = 0;
532
533                 preempt_enable();
534         }
535         return ret;
536 }
537
538 extern void module_put(struct module *module);
539
540 #else /*!CONFIG_MODULE_UNLOAD*/
541 static inline int try_module_get(struct module *module)
542 {
543         return !module || module_is_live(module);
544 }
545 static inline void module_put(struct module *module)
546 {
547 }
548 static inline void __module_get(struct module *module)
549 {
550 }
551 #define symbol_put(x) do { } while(0)
552 #define symbol_put_addr(p) do { } while(0)
553
554 #endif /* CONFIG_MODULE_UNLOAD */
555 int ref_module(struct module *a, struct module *b);
556
557 /* This is a #define so the string doesn't get put in every .o file */
558 #define module_name(mod)                        \
559 ({                                              \
560         struct module *__mod = (mod);           \
561         __mod ? __mod->name : "kernel";         \
562 })
563
564 /* For kallsyms to ask for address resolution.  namebuf should be at
565  * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
566  * found, otherwise NULL. */
567 const char *module_address_lookup(unsigned long addr,
568                             unsigned long *symbolsize,
569                             unsigned long *offset,
570                             char **modname,
571                             char *namebuf);
572 int lookup_module_symbol_name(unsigned long addr, char *symname);
573 int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
574
575 /* For extable.c to search modules' exception tables. */
576 const struct exception_table_entry *search_module_extables(unsigned long addr);
577
578 int register_module_notifier(struct notifier_block * nb);
579 int unregister_module_notifier(struct notifier_block * nb);
580
581 extern void print_modules(void);
582
583 extern void module_update_tracepoints(void);
584 extern int module_get_iter_tracepoints(struct tracepoint_iter *iter);
585
586 #else /* !CONFIG_MODULES... */
587 #define EXPORT_SYMBOL(sym)
588 #define EXPORT_SYMBOL_GPL(sym)
589 #define EXPORT_SYMBOL_GPL_FUTURE(sym)
590 #define EXPORT_UNUSED_SYMBOL(sym)
591 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
592
593 /* Given an address, look for it in the exception tables. */
594 static inline const struct exception_table_entry *
595 search_module_extables(unsigned long addr)
596 {
597         return NULL;
598 }
599
600 static inline struct module *__module_address(unsigned long addr)
601 {
602         return NULL;
603 }
604
605 static inline struct module *__module_text_address(unsigned long addr)
606 {
607         return NULL;
608 }
609
610 static inline bool is_module_address(unsigned long addr)
611 {
612         return false;
613 }
614
615 static inline bool is_module_percpu_address(unsigned long addr)
616 {
617         return false;
618 }
619
620 static inline bool is_module_text_address(unsigned long addr)
621 {
622         return false;
623 }
624
625 /* Get/put a kernel symbol (calls should be symmetric) */
626 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
627 #define symbol_put(x) do { } while(0)
628 #define symbol_put_addr(x) do { } while(0)
629
630 static inline void __module_get(struct module *module)
631 {
632 }
633
634 static inline int try_module_get(struct module *module)
635 {
636         return 1;
637 }
638
639 static inline void module_put(struct module *module)
640 {
641 }
642
643 #define module_name(mod) "kernel"
644
645 /* For kallsyms to ask for address resolution.  NULL means not found. */
646 static inline const char *module_address_lookup(unsigned long addr,
647                                           unsigned long *symbolsize,
648                                           unsigned long *offset,
649                                           char **modname,
650                                           char *namebuf)
651 {
652         return NULL;
653 }
654
655 static inline int lookup_module_symbol_name(unsigned long addr, char *symname)
656 {
657         return -ERANGE;
658 }
659
660 static inline int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name)
661 {
662         return -ERANGE;
663 }
664
665 static inline int module_get_kallsym(unsigned int symnum, unsigned long *value,
666                                         char *type, char *name,
667                                         char *module_name, int *exported)
668 {
669         return -ERANGE;
670 }
671
672 static inline unsigned long module_kallsyms_lookup_name(const char *name)
673 {
674         return 0;
675 }
676
677 static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
678                                                            struct module *,
679                                                            unsigned long),
680                                                  void *data)
681 {
682         return 0;
683 }
684
685 static inline int register_module_notifier(struct notifier_block * nb)
686 {
687         /* no events will happen anyway, so this can always succeed */
688         return 0;
689 }
690
691 static inline int unregister_module_notifier(struct notifier_block * nb)
692 {
693         return 0;
694 }
695
696 #define module_put_and_exit(code) do_exit(code)
697
698 static inline void print_modules(void)
699 {
700 }
701
702 static inline void module_update_tracepoints(void)
703 {
704 }
705
706 static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter)
707 {
708         return 0;
709 }
710 #endif /* CONFIG_MODULES */
711
712 #ifdef CONFIG_SYSFS
713 extern struct kset *module_kset;
714 extern struct kobj_type module_ktype;
715 extern int module_sysfs_initialized;
716 #endif /* CONFIG_SYSFS */
717
718 #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
719
720 /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
721
722 #define __MODULE_STRING(x) __stringify(x)
723
724 #ifdef CONFIG_DEBUG_SET_MODULE_RONX
725 extern void set_all_modules_text_rw(void);
726 extern void set_all_modules_text_ro(void);
727 #else
728 static inline void set_all_modules_text_rw(void) { }
729 static inline void set_all_modules_text_ro(void) { }
730 #endif
731
732 #ifdef CONFIG_GENERIC_BUG
733 void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
734                          struct module *);
735 void module_bug_cleanup(struct module *);
736
737 #else   /* !CONFIG_GENERIC_BUG */
738
739 static inline void module_bug_finalize(const Elf_Ehdr *hdr,
740                                         const Elf_Shdr *sechdrs,
741                                         struct module *mod)
742 {
743 }
744 static inline void module_bug_cleanup(struct module *mod) {}
745 #endif  /* CONFIG_GENERIC_BUG */
746
747 #endif /* _LINUX_MODULE_H */