Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / lwk / init.h
1 #ifndef _LWK_INIT_H
2 #define _LWK_INIT_H
3
4 #include <lwk/compiler.h>
5
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
11  *
12  * Usage:
13  * For functions:
14  * 
15  * You should add __init immediately before the function name, like:
16  *
17  * static void __init initme(int x, int y)
18  * {
19  *    extern int z; z = x * y;
20  * }
21  *
22  * If the function has a prototype somewhere, you can also add
23  * __init between closing brace of the prototype and semicolon:
24  *
25  * extern int initialize_foobar_device(int, int, int) __init;
26  *
27  * For initialized data:
28  * You should insert __initdata between the variable name and equal
29  * sign followed by value, e.g.:
30  *
31  * static int init_variable __initdata = 0;
32  * static char linux_logo[] __initdata = { 0x32, 0x36, ... };
33  *
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
36  * section.
37  * 
38  * Also note, that this data cannot be "const".
39  */
40
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
51
52 /* For assembly routines */
53 #define __INIT          .section        ".init.text","ax"
54 #define __FINIT         .previous
55 #define __INITDATA      .section        ".init.data","aw"
56
57 /* TODO: move this */
58 #define COMMAND_LINE_SIZE       1024
59
60 #ifndef __ASSEMBLY__
61
62 #include <lwk/types.h>
63
64 /* Defined in init/main.c */
65 extern char lwk_command_line[COMMAND_LINE_SIZE];
66
67 /* used by init/main.c */
68 extern void setup_arch(void);
69
70 extern void start_kernel(void);
71
72 extern int create_init_task(void);
73 extern paddr_t init_elf_image;
74
75 #endif /* !__ASSEMBLY__ */
76   
77 #endif /* _LWK_INIT_H */