init_task.h 1.59 KB
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds's avatar
Linus Torvalds committed
2 3 4
#ifndef _LINUX__INIT_TASK_H
#define _LINUX__INIT_TASK_H

5
#include <linux/rcupdate.h>
6
#include <linux/irqflags.h>
7
#include <linux/utsname.h>
Ingo Molnar's avatar
Ingo Molnar committed
8
#include <linux/lockdep.h>
9
#include <linux/ftrace.h>
10
#include <linux/ipc.h>
Cedric Le Goater's avatar
Cedric Le Goater committed
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/sched/autogroup.h>
17
#include <net/net_namespace.h>
18
#include <linux/sched/rt.h>
19
#include <linux/livepatch.h>
20
#include <linux/mm_types.h>
Linus Torvalds's avatar
Linus Torvalds committed
21

22 23
#include <asm/thread_info.h>

24
extern struct files_struct init_files;
Al Viro's avatar
Al Viro committed
25
extern struct fs_struct init_fs;
26 27 28
extern struct nsproxy init_nsproxy;
extern struct group_info init_groups;
extern struct cred init_cred;
Linus Torvalds's avatar
Linus Torvalds committed
29

30 31 32 33 34 35 36 37
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
#define INIT_PREV_CPUTIME(x)	.prev_cputime = {			\
	.lock = __RAW_SPIN_LOCK_UNLOCKED(x.prev_cputime.lock),		\
},
#else
#define INIT_PREV_CPUTIME(x)
#endif

38 39 40 41 42
#ifdef CONFIG_POSIX_TIMERS
#define INIT_CPU_TIMERS(s)						\
	.cpu_timers = {							\
		LIST_HEAD_INIT(s.cpu_timers[0]),			\
		LIST_HEAD_INIT(s.cpu_timers[1]),			\
43
		LIST_HEAD_INIT(s.cpu_timers[2]),			\
44 45 46 47 48
	},
#else
#define INIT_CPU_TIMERS(s)
#endif

49 50
#define INIT_TASK_COMM "swapper"

51
/* Attach to the init_task data structure for proper alignment */
52
#ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK
53
#define __init_task_data __attribute__((__section__(".data..init_task")))
54 55 56
#else
#define __init_task_data /**/
#endif
57

58 59 60
/* Attach to the thread_info data structure for proper alignment */
#define __init_thread_info __attribute__((__section__(".data..init_thread_info")))

Linus Torvalds's avatar
Linus Torvalds committed
61
#endif