1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _TOOLS_LINUX_INIT_H_ 3 #define _TOOLS_LINUX_INIT_H_ 4 5 #include <linux/compiler.h> 6 7 #ifndef __init 8 # define __init 9 #endif 10 11 #ifndef __exit 12 # define __exit 13 #endif 14 15 #define __section(section) __attribute__((__section__(section))) 16 17 #define __initconst 18 #define __meminit 19 #define __meminitdata 20 #define __refdata 21 #define __initdata 22 23 struct obs_kernel_param { 24 const char *str; 25 int (*setup_func)(char *st); 26 int early; 27 }; 28 29 #define __setup_param(str, unique_id, fn, early) \ 30 static const char __setup_str_##unique_id[] __initconst \ 31 __aligned(1) = str; \ 32 static struct obs_kernel_param __setup_##unique_id \ 33 __used __section(".init.setup") \ 34 __aligned(__alignof__(struct obs_kernel_param)) = \ 35 { __setup_str_##unique_id, fn, early } 36 37 #define __setup(str, fn) \ 38 __setup_param(str, fn, fn, 0) 39 40 #define early_param(str, fn) \ 41 __setup_param(str, fn, fn, 1) 42 43 #endif /* _TOOLS_LINUX_INIT_H_ */ 44
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.