1 #ifndef _ASM_MIPS_MODULE_H
2 #define _ASM_MIPS_MODULE_H
4 * This file contains the mips architecture specific module code.
7 #include <linux/module.h>
8 #include <asm/uaccess.h>
10 #define module_map(x) vmalloc(x)
11 #define module_unmap(x) vfree(x)
12 #define module_arch_init(x) mips_module_init(x)
13 #define arch_init_modules(x) mips_init_modules(x)
16 * This must match in size and layout the data created by
17 * modutils/obj/obj-mips.c
20 const struct exception_table_entry *dbe_table_start;
21 const struct exception_table_entry *dbe_table_end;
25 mips_module_init(struct module *mod)
27 struct archdata *archdata;
29 if (!mod_member_present(mod, archdata_end))
32 archdata = (struct archdata *)(mod->archdata_start);
33 if (!mod_archdata_member_present(mod, struct archdata, dbe_table_end))
36 if (archdata->dbe_table_start > archdata->dbe_table_end ||
37 (archdata->dbe_table_start &&
38 !((unsigned long)archdata->dbe_table_start >=
39 ((unsigned long)mod + mod->size_of_struct) &&
40 ((unsigned long)archdata->dbe_table_end <
41 (unsigned long)mod + mod->size))) ||
42 (((unsigned long)archdata->dbe_table_start -
43 (unsigned long)archdata->dbe_table_end) %
44 sizeof(struct exception_table_entry))) {
46 "module_arch_init: archdata->dbe_table_* invalid.\n");
54 mips_init_modules(struct module *mod)
56 extern const struct exception_table_entry __start___dbe_table[];
57 extern const struct exception_table_entry __stop___dbe_table[];
58 static struct archdata archdata = {
59 .dbe_table_start = __start___dbe_table,
60 .dbe_table_end = __stop___dbe_table,
63 mod->archdata_start = (char *)&archdata;
64 mod->archdata_end = mod->archdata_start + sizeof(archdata);
67 #endif /* _ASM_MIPS_MODULE_H */