1 #ifndef _LINUX__INIT_TASK_H
2 #define _LINUX__INIT_TASK_H
4 #include <linux/file.h>
5 #include <linux/rcupdate.h>
6 #include <linux/irqflags.h>
7 #include <linux/lockdep.h>
11 .max_fds = NR_OPEN_DEFAULT, \
12 .max_fdset = EMBEDDED_FD_SET_SIZE, \
13 .fd = &init_files.fd_array[0], \
14 .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \
15 .open_fds = (fd_set *)&init_files.open_fds_init, \
16 .rcu = RCU_HEAD_INIT, \
23 .count = ATOMIC_INIT(1), \
24 .fdt = &init_files.fdtab, \
25 .fdtab = INIT_FDTABLE, \
26 .file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock), \
28 .close_on_exec_init = { { 0, } }, \
29 .open_fds_init = { { 0, } }, \
30 .fd_array = { NULL, } \
33 #define INIT_KIOCTX(name, which_mm) \
35 .users = ATOMIC_INIT(1), \
40 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \
41 .ctx_lock = __SPIN_LOCK_UNLOCKED(name.ctx_lock), \
46 #define INIT_MM(name) \
49 .pgd = swapper_pg_dir, \
50 .mm_users = ATOMIC_INIT(2), \
51 .mm_count = ATOMIC_INIT(1), \
52 .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \
53 .page_table_lock = __SPIN_LOCK_UNLOCKED(name.page_table_lock), \
54 .mmlist = LIST_HEAD_INIT(name.mmlist), \
55 .cpu_vm_mask = CPU_MASK_ALL, \
58 #define INIT_SIGNALS(sig) { \
59 .count = ATOMIC_INIT(1), \
60 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
62 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
64 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
65 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
66 .rlim = INIT_RLIMITS, \
71 #define INIT_SIGHAND(sighand) { \
72 .count = ATOMIC_INIT(1), \
73 .action = { { { .sa_handler = NULL, } }, }, \
74 .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \
77 extern struct group_info init_groups;
80 * INIT_TASK is used to set up the first task table, touch at
81 * your own risk!. Base=0, limit=0x1fffff (=2MB)
83 #define INIT_TASK(tsk) \
86 .thread_info = &init_thread_info, \
87 .usage = ATOMIC_INIT(2), \
90 .prio = MAX_PRIO-20, \
91 .static_prio = MAX_PRIO-20, \
92 .normal_prio = MAX_PRIO-20, \
93 .policy = SCHED_NORMAL, \
94 .cpus_allowed = CPU_MASK_ALL, \
96 .active_mm = &init_mm, \
97 .run_list = LIST_HEAD_INIT(tsk.run_list), \
100 .tasks = LIST_HEAD_INIT(tsk.tasks), \
101 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \
102 .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \
103 .real_parent = &tsk, \
105 .children = LIST_HEAD_INIT(tsk.children), \
106 .sibling = LIST_HEAD_INIT(tsk.sibling), \
107 .group_leader = &tsk, \
108 .group_info = &init_groups, \
109 .cap_effective = CAP_INIT_EFF_SET, \
110 .cap_inheritable = CAP_INIT_INH_SET, \
111 .cap_permitted = CAP_FULL_SET, \
112 .keep_capabilities = 0, \
115 .thread = INIT_THREAD, \
117 .files = &init_files, \
118 .signal = &init_signals, \
119 .sighand = &init_sighand, \
121 .list = LIST_HEAD_INIT(tsk.pending.list), \
124 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
125 .journal_info = NULL, \
126 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
127 .fs_excl = ATOMIC_INIT(0), \
128 .pi_lock = SPIN_LOCK_UNLOCKED, \
129 INIT_TRACE_IRQFLAGS \
134 #define INIT_CPU_TIMERS(cpu_timers) \
136 LIST_HEAD_INIT(cpu_timers[0]), \
137 LIST_HEAD_INIT(cpu_timers[1]), \
138 LIST_HEAD_INIT(cpu_timers[2]), \