Skip to content

Commit

Permalink
Allow arch to initialize arch field of the module structure
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Roman Zippel authored and Linus Torvalds committed May 9, 2007
1 parent b52f52a commit e61a1c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit e61a1c1

Please sign in to comment.