xref: /linux/include/linux/init_task.h (revision 44f57d78)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX__INIT_TASK_H
3 #define _LINUX__INIT_TASK_H
4 
5 #include <linux/rcupdate.h>
6 #include <linux/irqflags.h>
7 #include <linux/utsname.h>
8 #include <linux/lockdep.h>
9 #include <linux/ftrace.h>
10 #include <linux/ipc.h>
11 #include <linux/pid_namespace.h>
12 #include <linux/user_namespace.h>
13 #include <linux/securebits.h>
14 #include <linux/seqlock.h>
15 #include <linux/rbtree.h>
16 #include <linux/refcount.h>
17 #include <linux/sched/autogroup.h>
18 #include <net/net_namespace.h>
19 #include <linux/sched/rt.h>
20 #include <linux/livepatch.h>
21 #include <linux/mm_types.h>
22 
23 #include <asm/thread_info.h>
24 
25 extern struct files_struct init_files;
26 extern struct fs_struct init_fs;
27 extern struct nsproxy init_nsproxy;
28 extern struct group_info init_groups;
29 extern struct cred init_cred;
30 
31 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
32 #define INIT_PREV_CPUTIME(x)	.prev_cputime = {			\
33 	.lock = __RAW_SPIN_LOCK_UNLOCKED(x.prev_cputime.lock),		\
34 },
35 #else
36 #define INIT_PREV_CPUTIME(x)
37 #endif
38 
39 #ifdef CONFIG_POSIX_TIMERS
40 #define INIT_CPU_TIMERS(s)						\
41 	.cpu_timers = {							\
42 		LIST_HEAD_INIT(s.cpu_timers[0]),			\
43 		LIST_HEAD_INIT(s.cpu_timers[1]),			\
44 		LIST_HEAD_INIT(s.cpu_timers[2]),			\
45 	},
46 #else
47 #define INIT_CPU_TIMERS(s)
48 #endif
49 
50 #define INIT_TASK_COMM "swapper"
51 
52 /* Attach to the init_task data structure for proper alignment */
53 #ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK
54 #define __init_task_data __attribute__((__section__(".data..init_task")))
55 #else
56 #define __init_task_data /**/
57 #endif
58 
59 /* Attach to the thread_info data structure for proper alignment */
60 #define __init_thread_info __attribute__((__section__(".data..init_thread_info")))
61 
62 #endif
63