xref: /linux-6.15/include/linux/init_task.h (revision f0b89d39)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
21da177e4SLinus Torvalds #ifndef _LINUX__INIT_TASK_H
31da177e4SLinus Torvalds #define _LINUX__INIT_TASK_H
41da177e4SLinus Torvalds 
5ab2af1f5SDipankar Sarma #include <linux/rcupdate.h>
6de30a2b3SIngo Molnar #include <linux/irqflags.h>
74865ecf1SSerge E. Hallyn #include <linux/utsname.h>
8fbb9ce95SIngo Molnar #include <linux/lockdep.h>
95ac9f622SSteven Rostedt #include <linux/ftrace.h>
1073ea4130SKirill Korotaev #include <linux/ipc.h>
119a575a92SCedric Le Goater #include <linux/pid_namespace.h>
12acce292cSCedric Le Goater #include <linux/user_namespace.h>
133898b1b4SAndrew G. Morgan #include <linux/securebits.h>
146a61671bSFrederic Weisbecker #include <linux/seqlock.h>
15fb00aca4SPeter Zijlstra #include <linux/rbtree.h>
16*f0b89d39SElena Reshetova #include <linux/refcount.h>
17dfc3401aSIngo Molnar #include <linux/sched/autogroup.h>
18772698f6SEric W. Biederman #include <net/net_namespace.h>
1977852feaSIngo Molnar #include <linux/sched/rt.h>
20d83a7cb3SJosh Poimboeuf #include <linux/livepatch.h>
21589ee628SIngo Molnar #include <linux/mm_types.h>
221da177e4SLinus Torvalds 
23c65eacbeSAndy Lutomirski #include <asm/thread_info.h>
24c65eacbeSAndy Lutomirski 
25f52111b1SAl Viro extern struct files_struct init_files;
2618d8fda7SAl Viro extern struct fs_struct init_fs;
273678e2fcSDavid Howells extern struct nsproxy init_nsproxy;
283678e2fcSDavid Howells extern struct group_info init_groups;
293678e2fcSDavid Howells extern struct cred init_cred;
301da177e4SLinus Torvalds 
319d7fb042SPeter Zijlstra #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
329d7fb042SPeter Zijlstra #define INIT_PREV_CPUTIME(x)	.prev_cputime = {			\
339d7fb042SPeter Zijlstra 	.lock = __RAW_SPIN_LOCK_UNLOCKED(x.prev_cputime.lock),		\
349d7fb042SPeter Zijlstra },
359d7fb042SPeter Zijlstra #else
369d7fb042SPeter Zijlstra #define INIT_PREV_CPUTIME(x)
379d7fb042SPeter Zijlstra #endif
389d7fb042SPeter Zijlstra 
39b18b6a9cSNicolas Pitre #ifdef CONFIG_POSIX_TIMERS
40b18b6a9cSNicolas Pitre #define INIT_CPU_TIMERS(s)						\
41b18b6a9cSNicolas Pitre 	.cpu_timers = {							\
42b18b6a9cSNicolas Pitre 		LIST_HEAD_INIT(s.cpu_timers[0]),			\
43b18b6a9cSNicolas Pitre 		LIST_HEAD_INIT(s.cpu_timers[1]),			\
44b18b6a9cSNicolas Pitre 		LIST_HEAD_INIT(s.cpu_timers[2]),			\
45b18b6a9cSNicolas Pitre 	},
46b18b6a9cSNicolas Pitre #else
47b18b6a9cSNicolas Pitre #define INIT_CPU_TIMERS(s)
48b18b6a9cSNicolas Pitre #endif
49b18b6a9cSNicolas Pitre 
50f1c6f1a7SCarsten Emde #define INIT_TASK_COMM "swapper"
51f1c6f1a7SCarsten Emde 
52857eceebSTim Abbott /* Attach to the init_task data structure for proper alignment */
53d11ed3abSDavid Howells #ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK
542af7687fSTim Abbott #define __init_task_data __attribute__((__section__(".data..init_task")))
55d11ed3abSDavid Howells #else
56d11ed3abSDavid Howells #define __init_task_data /**/
57d11ed3abSDavid Howells #endif
58857eceebSTim Abbott 
590500871fSDavid Howells /* Attach to the thread_info data structure for proper alignment */
600500871fSDavid Howells #define __init_thread_info __attribute__((__section__(".data..init_thread_info")))
610500871fSDavid Howells 
621da177e4SLinus Torvalds #endif
63