Go to the documentation of this file. 1 #ifndef _LINUX_UML_INIT_H
2 #define _LINUX_UML_INIT_H
45 # define __section(S) __attribute__ ((__section__(#S)))
50 #if __GNUC_MINOR__ >= 3
51 # define __used __attribute__((__used__))
53 # define __used __attribute__((__unused__))
58 # define __used __attribute__((__used__))
63 #include <linux/compiler.h>
67 #define __init __section(.init.text)
68 #define __initdata __section(.init.data)
69 #define __exitdata __section(.exit.data)
70 #define __exit_call __used __section(.exitcall.exit)
73 #define __exit __section(.exit.text)
75 #define __exit __used __section(.exit.text)
91 #define __uml_initcall(fn) \
92 static initcall_t __uml_initcall_##fn __uml_init_call = fn
94 #define __uml_exitcall(fn) \
95 static exitcall_t __uml_exitcall_##fn __uml_exit_call = fn
99 #define __uml_postsetup(fn) \
100 static initcall_t __uml_postsetup_##fn __uml_postsetup_call = fn
102 #define __non_empty_string(dummyname,string) \
103 struct __uml_non_empty_string_struct_##dummyname \
105 char _string[sizeof(string)-2]; \
109 #define __uml_setup(str, fn, help...) \
110 __non_empty_string(fn ##_setup, str); \
111 __uml_help(fn, help); \
112 static char __uml_setup_str_##fn[] __initdata = str; \
113 static struct uml_param __uml_setup_##fn __uml_init_setup = { __uml_setup_str_##fn, fn }
115 #define __uml_setup(str, fn, help...) \
119 #define __uml_help(fn, help...) \
120 __non_empty_string(fn ##__help, help); \
121 static char __uml_help_str_##fn[] __initdata = help; \
122 static const char *__uml_help_##fn __uml_setup_help = __uml_help_str_##fn
128 #define __uml_init_setup __used __section(.uml.setup.init)
129 #define __uml_setup_help __used __section(.uml.help.init)
130 #define __uml_init_call __used __section(.uml.initcall.init)
131 #define __uml_postsetup_call __used __section(.uml.postsetup.init)
132 #define __uml_exit_call __used __section(.uml.exitcall.exit)
136 #define __define_initcall(level,fn) \
137 static initcall_t __initcall_##fn __used \
138 __attribute__((__section__(".initcall" level ".init"))) = fn
143 #define __initcall(fn) __define_initcall("1", fn)
145 #define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn
147 #define __init_call __used __section(.initcall.init)