Better interface for hooking early initcalls
[deliverable/linux.git] / include / linux / init.h
index a404a0055dd7400489f5cc2ecff32c45d87f61ce..11b84e1060532ecf62f73e3151b9f6eaed043c8b 100644 (file)
@@ -42,6 +42,7 @@
    discard it in modules) */
 #define __init         __section(.init.text) __cold
 #define __initdata     __section(.init.data)
+#define __initconst    __section(.init.rodata)
 #define __exitdata     __section(.exit.data)
 #define __exit_call    __used __section(.exitcall.exit)
 
 #define __memexitconst   __section(.memexit.rodata)
 
 /* For assembly routines */
+#define __HEAD         .section        ".head.text","ax"
 #define __INIT         .section        ".init.text","ax"
 #define __FINIT                .previous
 
@@ -145,6 +147,8 @@ extern unsigned int reset_devices;
 void setup_arch(char **);
 void prepare_namespace(void);
 
+extern void (*late_time_init)(void);
+
 #endif
   
 #ifndef MODULE
@@ -165,6 +169,13 @@ void prepare_namespace(void);
        static initcall_t __initcall_##fn##id __used \
        __attribute__((__section__(".initcall" level ".init"))) = fn
 
+/*
+ * Early initcalls run before initializing SMP.
+ *
+ * Only for built-in code, not modules.
+ */
+#define early_initcall(fn)             __define_initcall("early",fn,early)
+
 /*
  * A "pure" initcall has no dependencies on anything else, and purely
  * initializes variables that couldn't be statically initialized.
@@ -271,13 +282,7 @@ void __init parse_early_param(void);
 
 #define security_initcall(fn)          module_init(fn)
 
-/* These macros create a dummy inline: gcc 2.9x does not count alias
- as usage, hence the `unused function' warning when __init functions
- are declared static. We use the dummy __*_module_inline functions
- both to kill the warning and check the type of the init/cleanup
- function. */
-
-/* Each module must use one module_init(), or one no_module_init */
+/* Each module must use one module_init(). */
 #define module_init(initfn)                                    \
        static inline initcall_t __inittest(void)               \
        { return initfn; }                                      \
This page took 0.025899 seconds and 5 git commands to generate.