Pārlūkot izejas kodu

Allow arch to initialize arch field of the module structure

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>
Roman Zippel 18 gadi atpakaļ
vecāks
revīzija
e61a1c1c4f
2 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 3 0
      include/linux/module.h
  2. 1 0
      scripts/mod/modpost.c

+ 3 - 0
include/linux/module.h

@@ -356,6 +356,9 @@ struct module
 	   keeping pointers to this stuff */
 	   keeping pointers to this stuff */
 	char *args;
 	char *args;
 };
 };
+#ifndef MODULE_ARCH_INIT
+#define MODULE_ARCH_INIT {}
+#endif
 
 
 /* FIXME: It'd be nice to isolate modules during init, too, so they
 /* 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
    aren't used before they (may) fail.  But presently too much code

+ 1 - 0
scripts/mod/modpost.c

@@ -1343,6 +1343,7 @@ static void add_header(struct buffer *b, struct module *mod)
 		buf_printf(b, "#ifdef CONFIG_MODULE_UNLOAD\n"
 		buf_printf(b, "#ifdef CONFIG_MODULE_UNLOAD\n"
 			      " .exit = cleanup_module,\n"
 			      " .exit = cleanup_module,\n"
 			      "#endif\n");
 			      "#endif\n");
+	buf_printf(b, " .arch = MODULE_ARCH_INIT,\n");
 	buf_printf(b, "};\n");
 	buf_printf(b, "};\n");
 }
 }