patch-2.4.10 linux/include/asm-mips64/module.h
Next file: linux/include/asm-mips64/namei.h
Previous file: linux/include/asm-mips64/mmu_context.h
Back to the patch index
Back to the overall index
- Lines: 66
- Date:
Sun Sep 9 10:43:02 2001
- Orig file:
v2.4.9/linux/include/asm-mips64/module.h
- Orig date:
Tue Nov 7 10:46:04 2000
diff -u --recursive --new-file v2.4.9/linux/include/asm-mips64/module.h linux/include/asm-mips64/module.h
@@ -4,8 +4,64 @@
* This file contains the mips64 architecture specific module code.
*/
+#include <linux/module.h>
+#include <asm/uaccess.h>
+
#define module_map(x) vmalloc(x)
#define module_unmap(x) vfree(x)
-#define module_arch_init(x) (0)
+#define module_arch_init(x) mips64_module_init(x)
+#define arch_init_modules(x) mips64_init_modules(x)
+
+/*
+ * This must match in size and layout the data created by
+ * modutils/obj/obj-mips64.c
+ */
+struct archdata {
+ const struct exception_table_entry *dbe_table_start;
+ const struct exception_table_entry *dbe_table_end;
+};
+
+static inline int
+mips64_module_init(struct module *mod)
+{
+ struct archdata *archdata;
+
+ if (!mod_member_present(mod, archdata_end))
+ return 0;
+
+ archdata = (struct archdata *)(mod->archdata_start);
+ if (!mod_archdata_member_present(mod, struct archdata, dbe_table_end))
+ return 0;
+
+ if (archdata->dbe_table_start > archdata->dbe_table_end ||
+ (archdata->dbe_table_start &&
+ !((unsigned long)archdata->dbe_table_start >=
+ ((unsigned long)mod + mod->size_of_struct) &&
+ ((unsigned long)archdata->dbe_table_end <
+ (unsigned long)mod + mod->size))) ||
+ (((unsigned long)archdata->dbe_table_start -
+ (unsigned long)archdata->dbe_table_end) %
+ sizeof(struct exception_table_entry))) {
+ printk(KERN_ERR
+ "module_arch_init: archdata->dbe_table_* invalid.\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+static inline void
+mips64_init_modules(struct module *mod)
+{
+ extern const struct exception_table_entry __start___dbe_table[];
+ extern const struct exception_table_entry __stop___dbe_table[];
+ static struct archdata archdata = {
+ dbe_table_start: __start___dbe_table,
+ dbe_table_end: __stop___dbe_table,
+ };
+
+ mod->archdata_start = (char *)&archdata;
+ mod->archdata_end = mod->archdata_start + sizeof(archdata);
+}
#endif /* _ASM_MIPS64_MODULE_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)