[PATCH 1/3] compat: redefine core_initcall() and late_initcall()

From: Luis R. Rodriguez
Date: Sat Apr 06 2013 - 22:36:18 EST


From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxxxxxxxx>

It is questionable if we'd want to backport calls declared
through late_initcall() or core_initcall() on the kernel
but if this ends up being desired the current of copying
kernel code requires either patching or redefining these
symbols to make them build.

To avoid having to maintain patches for these components
and having to delcare these routines on header files through
compat manually use these init macros to help us define
symbols we *can* use on the compat module init.

Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
---
backport/include/linux/compat-2.6.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/backport/include/linux/compat-2.6.h b/backport/include/linux/compat-2.6.h
index 57a1c13..109afd4 100644
--- a/backport/include/linux/compat-2.6.h
+++ b/backport/include/linux/compat-2.6.h
@@ -18,6 +18,21 @@
#include <linux/init.h>
#include <linux/uidgid.h>

+#define backport_init_sym(fn) extern void backport_##fn(void);
+#define backport_init_call(fn) backport_##fn()
+
+#define backport_initcall(fn) \
+ void backport_##fn(void) \
+ { \
+ fn(); \
+ }
+
+#undef core_initcall
+#undef late_initcall
+
+#define core_initcall backport_initcall
+#define late_initcall backport_initcall
+
/*
* The define overwriting module_init is based on the original module_init
* which looks like this:
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/