Add basic support for mini2440 board to barebox.
[barebox-mini2440.git] / include / init.h
blob8692b68d07137a95ea3ab98fab547a56333e5e2a
1 #ifndef _INIT_H
2 #define _INIT_H
4 /*
5 * fake define to simplify the linux sync
6 */
7 #define __init
8 #define __initdata
10 typedef int (*initcall_t)(void);
12 #define __define_initcall(level,fn,id) \
13 static initcall_t __initcall_##fn##id __attribute__((__used__)) \
14 __attribute__((__section__(".initcall." level))) = fn
18 * A "pure" initcall has no dependencies on anything else, and purely
19 * initializes variables that couldn't be statically initialized.
21 * This only exists for built-in code, not for modules.
23 #define pure_initcall(fn) __define_initcall("0",fn,0)
25 #define core_initcall(fn) __define_initcall("1",fn,1)
26 #define postcore_initcall(fn) __define_initcall("2",fn,2)
27 #define console_initcall(fn) __define_initcall("3",fn,3)
28 #define postconsole_initcall(fn) __define_initcall("4",fn,4)
29 #define coredevice_initcall(fn) __define_initcall("5",fn,5)
30 #define fs_initcall(fn) __define_initcall("6",fn,6)
31 #define device_initcall(fn) __define_initcall("7",fn,7)
32 #define late_initcall(fn) __define_initcall("8",fn,8)
34 /* section for code used very early when
35 * - we're not running from where we linked at
36 * - bss not cleared
37 * - static variables not initialized
39 * Mainly useful for booting from NAND Controllers
41 #define __bare_init __section(.text_bare_init.text)
43 #endif /* _INIT_H */