diff options
Diffstat (limited to 'include/linux/init.h')
-rw-r--r-- | include/linux/init.h | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/include/linux/init.h b/include/linux/init.h index e92b1455d7af..ff40ea118e3a 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -84,19 +84,29 @@ extern void setup_arch(char **); | |||
84 | * by link order. | 84 | * by link order. |
85 | * For backwards compatibility, initcall() puts the call in | 85 | * For backwards compatibility, initcall() puts the call in |
86 | * the device init subsection. | 86 | * the device init subsection. |
87 | * | ||
88 | * The `id' arg to __define_initcall() is needed so that multiple initcalls | ||
89 | * can point at the same handler without causing duplicate-symbol build errors. | ||
87 | */ | 90 | */ |
88 | 91 | ||
89 | #define __define_initcall(level,fn) \ | 92 | #define __define_initcall(level,fn,id) \ |
90 | static initcall_t __initcall_##fn __attribute_used__ \ | 93 | static initcall_t __initcall_##fn##id __attribute_used__ \ |
91 | __attribute__((__section__(".initcall" level ".init"))) = fn | 94 | __attribute__((__section__(".initcall" level ".init"))) = fn |
92 | 95 | ||
93 | #define core_initcall(fn) __define_initcall("1",fn) | 96 | #define core_initcall(fn) __define_initcall("1",fn,1) |
94 | #define postcore_initcall(fn) __define_initcall("2",fn) | 97 | #define core_initcall_sync(fn) __define_initcall("1s",fn,1s) |
95 | #define arch_initcall(fn) __define_initcall("3",fn) | 98 | #define postcore_initcall(fn) __define_initcall("2",fn,2) |
96 | #define subsys_initcall(fn) __define_initcall("4",fn) | 99 | #define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) |
97 | #define fs_initcall(fn) __define_initcall("5",fn) | 100 | #define arch_initcall(fn) __define_initcall("3",fn,3) |
98 | #define device_initcall(fn) __define_initcall("6",fn) | 101 | #define arch_initcall_sync(fn) __define_initcall("3s",fn,3s) |
99 | #define late_initcall(fn) __define_initcall("7",fn) | 102 | #define subsys_initcall(fn) __define_initcall("4",fn,4) |
103 | #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) | ||
104 | #define fs_initcall(fn) __define_initcall("5",fn,5) | ||
105 | #define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) | ||
106 | #define device_initcall(fn) __define_initcall("6",fn,6) | ||
107 | #define device_initcall_sync(fn) __define_initcall("6s",fn,6s) | ||
108 | #define late_initcall(fn) __define_initcall("7",fn,7) | ||
109 | #define late_initcall_sync(fn) __define_initcall("7s",fn,7s) | ||
100 | 110 | ||
101 | #define __initcall(fn) device_initcall(fn) | 111 | #define __initcall(fn) device_initcall(fn) |
102 | 112 | ||