4 #include <lwk/compiler.h>
6 /* These macros are used to mark some functions or
7 * initialized data (doesn't apply to uninitialized data)
8 * as `initialization' functions. The kernel can take this
9 * as hint that the function is used only during the initialization
10 * phase and free up used memory resources after
15 * You should add __init immediately before the function name, like:
17 * static void __init initme(int x, int y)
19 * extern int z; z = x * y;
22 * If the function has a prototype somewhere, you can also add
23 * __init between closing brace of the prototype and semicolon:
25 * extern int initialize_foobar_device(int, int, int) __init;
27 * For initialized data:
28 * You should insert __initdata between the variable name and equal
29 * sign followed by value, e.g.:
31 * static int init_variable __initdata = 0;
32 * static char linux_logo[] __initdata = { 0x32, 0x36, ... };
34 * Don't forget to initialize data not at file scope, i.e. within a function,
35 * as gcc otherwise puts the data into the bss section and not into the init
38 * Also note, that this data cannot be "const".
41 /* These are for everybody (although not all archs will actually
42 discard it in modules) */
43 #define __init __attribute__ ((__section__ (".init.text")))
44 #define __meminit __init
45 #define __cpuinit __init
46 #define __initdata __attribute__ ((__section__ (".init.data")))
47 #define __exitdata __attribute__ ((__section__(".exit.data")))
48 #define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
49 #define __exit __attribute_used__ __attribute__ ((__section__(".exit.text")))
50 #define __cpuinitdata __initdata
52 /* For assembly routines */
53 #define __INIT .section ".init.text","ax"
54 #define __FINIT .previous
55 #define __INITDATA .section ".init.data","aw"
58 #define COMMAND_LINE_SIZE 1024
62 #include <lwk/types.h>
64 /* Defined in init/main.c */
65 extern char lwk_command_line[COMMAND_LINE_SIZE];
67 /* used by init/main.c */
68 extern void setup_arch(void);
70 extern void start_kernel(void);
72 extern int create_init_task(void);
73 extern paddr_t init_elf_image;
75 #endif /* !__ASSEMBLY__ */
77 #endif /* _LWK_INIT_H */