Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / include / linux / init.h
blob51b5cde28639c3d185a0ca015400efd17273e6ae
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _TOOLS_LINUX_INIT_H_
3 #define _TOOLS_LINUX_INIT_H_
5 #include <linux/compiler.h>
7 #ifndef __init
8 # define __init
9 #endif
11 #ifndef __exit
12 # define __exit
13 #endif
15 #define __section(section) __attribute__((__section__(section)))
17 #define __initconst
18 #define __meminit
19 #define __meminitdata
20 #define __refdata
21 #define __initdata
23 struct obs_kernel_param {
24 const char *str;
25 int (*setup_func)(char *st);
26 int early;
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 }
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_ */