blob: a7083a45a26c03f99cd13e887434b70d5487c154 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _LINUX__INIT_TASK_H
3#define _LINUX__INIT_TASK_H
4
Dipankar Sarmaab2af1f2005-09-09 13:04:13 -07005#include <linux/rcupdate.h>
Ingo Molnarde30a2b2006-07-03 00:24:42 -07006#include <linux/irqflags.h>
Serge E. Hallyn4865ecf2006-10-02 02:18:14 -07007#include <linux/utsname.h>
Ingo Molnarfbb9ce952006-07-03 00:24:50 -07008#include <linux/lockdep.h>
Steven Rostedt5ac9f622009-03-25 20:55:00 -04009#include <linux/ftrace.h>
Kirill Korotaev73ea4132006-10-02 02:18:20 -070010#include <linux/ipc.h>
Cedric Le Goater9a575a92006-12-08 02:37:59 -080011#include <linux/pid_namespace.h>
Cedric Le Goateracce2922007-07-15 23:40:59 -070012#include <linux/user_namespace.h>
Andrew G. Morgan3898b1b2008-04-28 02:13:40 -070013#include <linux/securebits.h>
Frederic Weisbecker6a616712012-12-16 20:00:34 +010014#include <linux/seqlock.h>
Peter Zijlstrafb00aca2013-11-07 14:43:43 +010015#include <linux/rbtree.h>
Ingo Molnardfc34012017-02-03 23:15:21 +010016#include <linux/sched/autogroup.h>
Eric W. Biederman772698f2007-09-12 11:55:17 +020017#include <net/net_namespace.h>
Ingo Molnar77852fe2013-02-16 09:46:48 +010018#include <linux/sched/rt.h>
Josh Poimboeufd83a7cb2017-02-13 19:42:40 -060019#include <linux/livepatch.h>
Ingo Molnar589ee622017-02-04 00:16:44 +010020#include <linux/mm_types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Andy Lutomirskic65eacb2016-09-13 14:29:24 -070022#include <asm/thread_info.h>
23
Al Virof52111b2008-05-08 18:19:16 -040024extern struct files_struct init_files;
Al Viro18d8fda2008-12-26 00:35:37 -050025extern struct fs_struct init_fs;
David Howells3678e2f2018-01-02 15:12:01 +000026extern struct nsproxy init_nsproxy;
27extern struct group_info init_groups;
28extern struct cred init_cred;
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Peter Zijlstra9d7fb042015-06-30 11:30:54 +020030#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
31#define INIT_PREV_CPUTIME(x) .prev_cputime = { \
32 .lock = __RAW_SPIN_LOCK_UNLOCKED(x.prev_cputime.lock), \
33},
34#else
35#define INIT_PREV_CPUTIME(x)
36#endif
37
Nicolas Pitreb18b6a92017-01-21 00:09:08 -050038#ifdef CONFIG_POSIX_TIMERS
Nicolas Pitreb18b6a92017-01-21 00:09:08 -050039#define INIT_CPU_TIMERS(s) \
40 .cpu_timers = { \
41 LIST_HEAD_INIT(s.cpu_timers[0]), \
42 LIST_HEAD_INIT(s.cpu_timers[1]), \
David Howells3678e2f2018-01-02 15:12:01 +000043 LIST_HEAD_INIT(s.cpu_timers[2]), \
Nicolas Pitreb18b6a92017-01-21 00:09:08 -050044 },
45#else
Nicolas Pitreb18b6a92017-01-21 00:09:08 -050046#define INIT_CPU_TIMERS(s)
Nicolas Pitreb18b6a92017-01-21 00:09:08 -050047#endif
48
Carsten Emdef1c6f1a2011-10-26 23:14:16 +020049#define INIT_TASK_COMM "swapper"
50
Tim Abbott857ecee2009-06-23 19:59:36 -040051/* Attach to the init_task data structure for proper alignment */
David Howellsd11ed3a2018-01-02 15:12:01 +000052#ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK
Tim Abbott2af76872010-02-20 01:03:35 +010053#define __init_task_data __attribute__((__section__(".data..init_task")))
David Howellsd11ed3a2018-01-02 15:12:01 +000054#else
55#define __init_task_data /**/
56#endif
Tim Abbott857ecee2009-06-23 19:59:36 -040057
David Howells05008712018-01-02 15:12:01 +000058/* Attach to the thread_info data structure for proper alignment */
59#define __init_thread_info __attribute__((__section__(".data..init_thread_info")))
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#endif