Revert "Roll NDK to r11c and extract it into its own repository."
[android_tools.git] / ndk / platforms / android-18 / arch-mips / usr / include / linux / init.h
blob846c4eb5e580ca1c90794f3e1c48135fd3beeedc
1 /****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _LINUX_INIT_H
13 #define _LINUX_INIT_H
15 #include <linux/compiler.h>
17 #define __init __attribute__ ((__section__ (".init.text")))
18 #define __initdata __attribute__ ((__section__ (".init.data")))
19 #define __exitdata __attribute__ ((__section__(".exit.data")))
20 #define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
22 #ifdef MODULE
23 #define __exit __attribute__ ((__section__(".exit.text")))
24 #else
25 #define __exit __attribute_used__ __attribute__ ((__section__(".exit.text")))
26 #endif
28 #define __INIT .section ".init.text","ax"
29 #define __FINIT .previous
30 #define __INITDATA .section ".init.data","aw"
32 #ifndef __ASSEMBLY__
34 typedef int (*initcall_t)(void);
35 typedef void (*exitcall_t)(void);
37 #endif
39 #ifndef MODULE
41 #ifndef __ASSEMBLY__
43 #define __define_initcall(level,fn) static initcall_t __initcall_##fn __attribute_used__ __attribute__((__section__(".initcall" level ".init"))) = fn
45 #define core_initcall(fn) __define_initcall("1",fn)
46 #define postcore_initcall(fn) __define_initcall("2",fn)
47 #define arch_initcall(fn) __define_initcall("3",fn)
48 #define subsys_initcall(fn) __define_initcall("4",fn)
49 #define fs_initcall(fn) __define_initcall("5",fn)
50 #define device_initcall(fn) __define_initcall("6",fn)
51 #define late_initcall(fn) __define_initcall("7",fn)
53 #define __initcall(fn) device_initcall(fn)
55 #define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn
57 #define console_initcall(fn) static initcall_t __initcall_##fn __attribute_used__ __attribute__((__section__(".con_initcall.init")))=fn
59 #define security_initcall(fn) static initcall_t __initcall_##fn __attribute_used__ __attribute__((__section__(".security_initcall.init"))) = fn
61 struct obs_kernel_param {
62 const char *str;
63 int (*setup_func)(char *);
64 int early;
67 #define __setup_param(str, unique_id, fn, early) static char __setup_str_##unique_id[] __initdata = str; static struct obs_kernel_param __setup_##unique_id __attribute_used__ __attribute__((__section__(".init.setup"))) __attribute__((aligned((sizeof(long))))) = { __setup_str_##unique_id, fn, early }
69 #define __setup_null_param(str, unique_id) __setup_param(str, unique_id, NULL, 0)
71 #define __setup(str, fn) __setup_param(str, fn, fn, 0)
73 #define __obsolete_setup(str) __setup_null_param(str, __LINE__)
75 #define early_param(str, fn) __setup_param(str, fn, fn, 1)
77 #endif
79 #define module_init(x) __initcall(x);
81 #define module_exit(x) __exitcall(x);
83 #else
85 #define core_initcall(fn) module_init(fn)
86 #define postcore_initcall(fn) module_init(fn)
87 #define arch_initcall(fn) module_init(fn)
88 #define subsys_initcall(fn) module_init(fn)
89 #define fs_initcall(fn) module_init(fn)
90 #define device_initcall(fn) module_init(fn)
91 #define late_initcall(fn) module_init(fn)
93 #define security_initcall(fn) module_init(fn)
95 #define module_init(initfn) static inline initcall_t __inittest(void) { return initfn; } int init_module(void) __attribute__((alias(#initfn)));
97 #define module_exit(exitfn) static inline exitcall_t __exittest(void) { return exitfn; } void cleanup_module(void) __attribute__((alias(#exitfn)));
99 #define __setup_param(str, unique_id, fn)
100 #define __setup_null_param(str, unique_id)
101 #define __setup(str, func)
102 #define __obsolete_setup(str)
103 #endif
105 #define __nosavedata __attribute__ ((__section__ (".data.nosave")))
107 #define __init_or_module __init
108 #define __initdata_or_module __initdata
110 #define __devinit __init
111 #define __devinitdata __initdata
112 #define __devexit __exit
113 #define __devexitdata __exitdata
115 #define __cpuinit __init
116 #define __cpuinitdata __initdata
117 #define __cpuexit __exit
118 #define __cpuexitdata __exitdata
120 #define __meminit __init
121 #define __meminitdata __initdata
122 #define __memexit __exit
123 #define __memexitdata __exitdata
125 #ifdef MODULE
126 #define __devexit_p(x) x
127 #else
128 #define __devexit_p(x) NULL
129 #endif
131 #ifdef MODULE
132 #define __exit_p(x) x
133 #else
134 #define __exit_p(x) NULL
135 #endif
137 #endif