aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/bugfix/m68k/577-module-arch.diff
blob: 10e6823bbcf81dd5c1ad5303a26e7edcfdd129b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Subject: [PATCH] Allow arch to initialize arch field of the module structure

From: Roman Zippel <zippel@linux-m68k.org>

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>
---
 include/linux/module.h |    3 +++
 scripts/mod/modpost.c  |    1 +
 2 files changed, 4 insertions(+)

--- linux-m68k-2.6.21.orig/include/linux/module.h
+++ linux-m68k-2.6.21/include/linux/module.h
@@ -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
--- linux-m68k-2.6.21.orig/scripts/mod/modpost.c
+++ linux-m68k-2.6.21/scripts/mod/modpost.c
@@ -1249,6 +1249,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");
 }