Allow arch to initialize arch field of the module structure
authorRoman Zippel <zippel@linux-m68k.org>
Wed, 9 May 2007 09:35:15 +0000 (02:35 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:30:56 +0000 (12:30 -0700)
This will later allow an arch to add module specific information via linker
generated tables instead of poking directly in the module object structure.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/module.h
scripts/mod/modpost.c

index 6d3dc9c4ff9622163b0ff35759f13b62afc23641..792d483c9af732feef2b0845190373d1e7535124 100644 (file)
@@ -356,6 +356,9 @@ struct module
           keeping pointers to this stuff */
        char *args;
 };
+#ifndef MODULE_ARCH_INIT
+#define MODULE_ARCH_INIT {}
+#endif
 
 /* FIXME: It'd be nice to isolate modules during init, too, so they
    aren't used before they (may) fail.  But presently too much code
index 480e18b00aa6512857fb6b994829605b62854c53..113dc77b9f60f9e147239bc3daff8bc92164c80c 100644 (file)
@@ -1343,6 +1343,7 @@ static void add_header(struct buffer *b, struct module *mod)
                buf_printf(b, "#ifdef CONFIG_MODULE_UNLOAD\n"
                              " .exit = cleanup_module,\n"
                              "#endif\n");
+       buf_printf(b, " .arch = MODULE_ARCH_INIT,\n");
        buf_printf(b, "};\n");
 }