1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _TOOLS_LINUX_INIT_H_
3 #define _TOOLS_LINUX_INIT_H_
5 #include <linux/compiler.h>
15 #define __section(section) __attribute__((__section__(section)))
23 struct obs_kernel_param
{
25 int (*setup_func
)(char *st
);
29 #define __setup_param(str, unique_id, fn, early) \
30 static const char __setup_str_##unique_id[] __initconst \
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 }
37 #define __setup(str, fn) \
38 __setup_param(str, fn, fn, 0)
40 #define early_param(str, fn) \
41 __setup_param(str, fn, fn, 1)
43 #endif /* _TOOLS_LINUX_INIT_H_ */