From: Roman Zippel 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 Signed-off-by: Geert Uytterhoeven Signed-off-by: Andrew Morton --- include/linux/module.h | 3 +++ scripts/mod/modpost.c | 1 + 2 files changed, 4 insertions(+) diff -puN include/linux/module.h~allow-arch-to-initialize-arch-field-of-the-module-structure include/linux/module.h --- a/include/linux/module.h~allow-arch-to-initialize-arch-field-of-the-module-structure +++ a/include/linux/module.h @@ -360,6 +360,9 @@ struct module const struct __mark_marker *markers; unsigned int num_markers; }; +#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 diff -puN scripts/mod/modpost.c~allow-arch-to-initialize-arch-field-of-the-module-structure scripts/mod/modpost.c --- a/scripts/mod/modpost.c~allow-arch-to-initialize-arch-field-of-the-module-structure +++ a/scripts/mod/modpost.c @@ -1356,6 +1356,7 @@ static void add_header(struct buffer *b, 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"); } _