[PATCH] module_arch_cleanup()

Christoph Hellwig (hch@lst.de)
Thu, 8 May 2003 18:41:17 +0200


IA64 needs to be able to hook into module unloading to get rid of
the unwind tables for modules. (The actual implementation already
is in arch/ia64/kernel/module.c, David just seems to be to shy to
submit core changes :))

--- 1.11/include/asm-ia64/module.h Wed Mar 26 04:08:03 2003
+++ edited/include/asm-ia64/module.h Thu May 8 10:12:36 2003
@@ -31,4 +31,7 @@

#define ARCH_SHF_SMALL SHF_IA_64_SHORT

+void module_arch_cleanup(struct module *mod);
+#define __HAVE_ARCH_MODULE_CLEANUP 1
+
#endif /* _ASM_IA64_MODULE_H */
--- 1.80/kernel/module.c Wed Apr 30 10:17:38 2003
+++ edited/kernel/module.c Thu May 8 10:13:28 2003
@@ -47,6 +47,11 @@
#define ARCH_SHF_SMALL 0
#endif

+/* Some architectures (like ia64) need to hook into module unloading */
+#ifndef __HAVE_ARCH_MODULE_CLEANUP
+#define module_arch_cleanup(mod) do { } while (0)
+#endif
+
/* If this is set, the section belongs in the init part of the module */
#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))

@@ -909,6 +914,9 @@
spin_lock_irq(&modlist_lock);
list_del(&mod->list);
spin_unlock_irq(&modlist_lock);
+
+ /* Arch-specific cleanup. */
+ module_arch_cleanup(mod);

/* Module unload stuff */
module_unload_free(mod);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/