Rev 629 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
629 | giacomo | 1 | #ifndef _LINUX_INIT_H |
2 | #define _LINUX_INIT_H |
||
3 | |||
4 | /* MODIFIED!!! */ |
||
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 | * Depricated: you can surround the whole function declaration |
||
23 | * just before function body into __initfunc() macro, like: |
||
24 | * |
||
25 | * __initfunc (static void initme(int x, int y)) |
||
26 | * { |
||
27 | * extern int z; z = x * y; |
||
28 | * } |
||
29 | * |
||
30 | * If the function has a prototype somewhere, you can also add |
||
31 | * __init between closing brace of the prototype and semicolon: |
||
32 | * |
||
33 | * extern int initialize_foobar_device(int, int, int) __init; |
||
34 | * |
||
35 | * For initialized data: |
||
36 | * You should insert __initdata between the variable name and equal |
||
37 | * sign followed by value, e.g.: |
||
38 | * |
||
39 | * static int init_variable __initdata = 0; |
||
40 | * static char linux_logo[] __initdata = { 0x32, 0x36, ... }; |
||
41 | * |
||
42 | * For initialized data not at file scope, i.e. within a function, |
||
43 | * you should use __initlocaldata instead, due to a bug in GCC 2.7. |
||
44 | */ |
||
45 | |||
46 | /* |
||
47 | * Disable the __initfunc macros if a file that is a part of a |
||
48 | * module attempts to use them. We do not want to interfere |
||
49 | * with module linking. |
||
50 | */ |
||
51 | |||
52 | #define __init |
||
53 | #define __initdata |
||
54 | #define __initfunc(__arginit) __arginit |
||
55 | /* For assembly routines */ |
||
56 | #define __INIT |
||
57 | #define __FINIT |
||
58 | #define __INITDATA |
||
59 | |||
60 | #define __initlocaldata |
||
61 | |||
62 | #endif |