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