5 #include <linux/compiler.h>
8 #ifndef MODULE_SYMBOL_PREFIX
9 #define MODULE_SYMBOL_PREFIX
12 #define MODULE_NAME_LEN (64 - sizeof(unsigned long))
15 #include <asm/module.h>
23 struct module
* load_module(void *mod_image
, unsigned long len
);
25 /* For every exported symbol, place a struct in the __ksymtab section */
26 #define __EXPORT_SYMBOL(sym, sec) \
27 extern typeof(sym) sym; \
28 static const char __ustrtab_##sym[] \
29 __attribute__((section("__usymtab_strings"))) \
30 = MODULE_SYMBOL_PREFIX #sym; \
31 static const struct kernel_symbol __usymtab_##sym \
33 __attribute__((section("__usymtab" sec), unused)) \
34 = { (unsigned long)&sym, __ustrtab_##sym }
36 #define EXPORT_SYMBOL(sym) \
37 __EXPORT_SYMBOL(sym, "")
40 /* Unique handle for this module */
41 char name
[MODULE_NAME_LEN
];
43 /* Startup function. */
46 /* Here is the actual code + data, free'd on unload. */
49 /* Arch-specific module values */
50 struct mod_arch_specific arch
;
52 unsigned long core_size
;
54 struct list_head list
;
57 /* Apply the given relocation to the (simplified) ELF. Return -error
59 int apply_relocate(Elf_Shdr
*sechdrs
,
61 unsigned int symindex
,
65 /* Apply the given add relocation to the (simplified) ELF. Return
67 int apply_relocate_add(Elf_Shdr
*sechdrs
,
69 unsigned int symindex
,
73 #define EXPORT_SYMBOL(sym)
74 #endif /* CONFIG_MODULE */
76 extern struct list_head module_list
;
78 #define for_each_module(m) \
79 list_for_each_entry(m, &module_list, list)
81 #endif /* __MODULE_H */