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 14 15#include <linux/compiler.h> 16 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"))) 21 22#ifdef MODULE 23#define __exit __attribute__ ((__section__(".exit.text"))) 24#else 25#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text"))) 26#endif 27 28#define __INIT .section ".init.text","ax" 29#define __FINIT .previous 30#define __INITDATA .section ".init.data","aw" 31 32#ifndef __ASSEMBLY__ 33 34typedef int (*initcall_t)(void); 35typedef void (*exitcall_t)(void); 36 37#endif 38 39#ifndef MODULE 40 41#ifndef __ASSEMBLY__ 42 43#define __define_initcall(level,fn) static initcall_t __initcall_##fn __attribute_used__ __attribute__((__section__(".initcall" level ".init"))) = fn 44 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) 52 53#define __initcall(fn) device_initcall(fn) 54 55#define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn 56 57#define console_initcall(fn) static initcall_t __initcall_##fn __attribute_used__ __attribute__((__section__(".con_initcall.init")))=fn 58 59#define security_initcall(fn) static initcall_t __initcall_##fn __attribute_used__ __attribute__((__section__(".security_initcall.init"))) = fn 60 61struct obs_kernel_param { 62 const char *str; 63 int (*setup_func)(char *); 64 int early; 65}; 66 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 } 68 69#define __setup_null_param(str, unique_id) __setup_param(str, unique_id, NULL, 0) 70 71#define __setup(str, fn) __setup_param(str, fn, fn, 0) 72 73#define __obsolete_setup(str) __setup_null_param(str, __LINE__) 74 75#define early_param(str, fn) __setup_param(str, fn, fn, 1) 76 77#endif 78 79#define module_init(x) __initcall(x); 80 81#define module_exit(x) __exitcall(x); 82 83#else 84 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) 92 93#define security_initcall(fn) module_init(fn) 94 95#define module_init(initfn) static inline initcall_t __inittest(void) { return initfn; } int init_module(void) __attribute__((alias(#initfn))); 96 97#define module_exit(exitfn) static inline exitcall_t __exittest(void) { return exitfn; } void cleanup_module(void) __attribute__((alias(#exitfn))); 98 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 104 105#define __nosavedata __attribute__ ((__section__ (".data.nosave"))) 106 107#define __init_or_module __init 108#define __initdata_or_module __initdata 109 110#define __devinit __init 111#define __devinitdata __initdata 112#define __devexit __exit 113#define __devexitdata __exitdata 114 115#define __cpuinit __init 116#define __cpuinitdata __initdata 117#define __cpuexit __exit 118#define __cpuexitdata __exitdata 119 120#define __meminit __init 121#define __meminitdata __initdata 122#define __memexit __exit 123#define __memexitdata __exitdata 124 125#ifdef MODULE 126#define __devexit_p(x) x 127#else 128#define __devexit_p(x) NULL 129#endif 130 131#ifdef MODULE 132#define __exit_p(x) x 133#else 134#define __exit_p(x) NULL 135#endif 136 137#endif 138