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