aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/init.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-11-20 14:47:18 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-20 14:47:18 -0500
commitb3438f8266cb1f5010085ac47d7ad6a36a212164 (patch)
treebb74bd7a3ea7a629e380aa7761ba63a5e44992c7 /include/linux/init.h
parentf44ea623443ee0bec266d62f1cd346881224d47d (diff)
Add "pure_initcall" for static variable initialization
This is a quick hack to overcome the fact that SRCU currently does not allow static initializers, and we need to sometimes initialize those things before any other initializers (even "core" ones) can do so. Currently we don't allow this at all for modules, and the only user that needs is right now is cpufreq. As reported by Thomas Gleixner: "Commit b4dfdbb3c707474a2254c5b4d7e62be31a4b7da9 ("[PATCH] cpufreq: make the transition_notifier chain use SRCU breaks cpu frequency notification users, which register the callback > on core_init level." Cc: Thomas Gleixner <tglx@timesys.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Arjan van de Ven <arjan@infradead.org> Cc: Andrew Morton <akpm@osdl.org>, Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/init.h')
-rw-r--r--include/linux/init.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index ff40ea118e3..5eb5d24b768 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -93,6 +93,14 @@ extern void setup_arch(char **);
93 static initcall_t __initcall_##fn##id __attribute_used__ \ 93 static initcall_t __initcall_##fn##id __attribute_used__ \
94 __attribute__((__section__(".initcall" level ".init"))) = fn 94 __attribute__((__section__(".initcall" level ".init"))) = fn
95 95
96/*
97 * A "pure" initcall has no dependencies on anything else, and purely
98 * initializes variables that couldn't be statically initialized.
99 *
100 * This only exists for built-in code, not for modules.
101 */
102#define pure_initcall(fn) __define_initcall("0",fn,1)
103
96#define core_initcall(fn) __define_initcall("1",fn,1) 104#define core_initcall(fn) __define_initcall("1",fn,1)
97#define core_initcall_sync(fn) __define_initcall("1s",fn,1s) 105#define core_initcall_sync(fn) __define_initcall("1s",fn,1s)
98#define postcore_initcall(fn) __define_initcall("2",fn,2) 106#define postcore_initcall(fn) __define_initcall("2",fn,2)