1 #ifndef _LINUX__INIT_TASK_H
2 #define _LINUX__INIT_TASK_H
4 #include <linux/file.h>
5 #include <linux/rcupdate.h>
9 .max_fds = NR_OPEN_DEFAULT, \
10 .max_fdset = __FD_SETSIZE, \
12 .fd = &init_files.fd_array[0], \
13 .close_on_exec = &init_files.close_on_exec_init, \
14 .open_fds = &init_files.open_fds_init, \
15 .rcu = RCU_HEAD_INIT, \
22 .count = ATOMIC_INIT(1), \
23 .file_lock = SPIN_LOCK_UNLOCKED, \
24 .fdt = &init_files.fdtab, \
25 .fdtab = INIT_FDTABLE, \
26 .close_on_exec_init = { { 0, } }, \
27 .open_fds_init = { { 0, } }, \
28 .fd_array = { NULL, } \
31 #define INIT_KIOCTX(name, which_mm) \
33 .users = ATOMIC_INIT(1), \
38 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \
39 .ctx_lock = SPIN_LOCK_UNLOCKED, \
44 #define INIT_MM(name) \
47 .pgd = swapper_pg_dir, \
48 .mm_users = ATOMIC_INIT(2), \
49 .mm_count = ATOMIC_INIT(1), \
50 .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \
51 .page_table_lock = SPIN_LOCK_UNLOCKED, \
52 .mmlist = LIST_HEAD_INIT(name.mmlist), \
53 .cpu_vm_mask = CPU_MASK_ALL, \
54 .default_kioctx = INIT_KIOCTX(name.default_kioctx, name), \
57 #define INIT_SIGNALS(sig) { \
58 .count = ATOMIC_INIT(1), \
59 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
61 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
63 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
64 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
65 .rlim = INIT_RLIMITS, \
68 #define INIT_SIGHAND(sighand) { \
69 .count = ATOMIC_INIT(1), \
70 .action = { { { .sa_handler = NULL, } }, }, \
71 .siglock = SPIN_LOCK_UNLOCKED, \
74 extern struct group_info init_groups;
77 * INIT_TASK is used to set up the first task table, touch at
78 * your own risk!. Base=0, limit=0x1fffff (=2MB)
80 #define INIT_TASK(tsk) \
83 .thread_info = &init_thread_info, \
84 .usage = ATOMIC_INIT(2), \
87 .prio = MAX_PRIO-20, \
88 .static_prio = MAX_PRIO-20, \
89 .policy = SCHED_NORMAL, \
90 .cpus_allowed = CPU_MASK_ALL, \
92 .active_mm = &init_mm, \
93 .run_list = LIST_HEAD_INIT(tsk.run_list), \
96 .tasks = LIST_HEAD_INIT(tsk.tasks), \
97 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \
98 .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \
99 .real_parent = &tsk, \
101 .children = LIST_HEAD_INIT(tsk.children), \
102 .sibling = LIST_HEAD_INIT(tsk.sibling), \
103 .group_leader = &tsk, \
104 .group_info = &init_groups, \
105 .cap_effective = CAP_INIT_EFF_SET, \
106 .cap_inheritable = CAP_INIT_INH_SET, \
107 .cap_permitted = CAP_FULL_SET, \
108 .keep_capabilities = 0, \
111 .thread = INIT_THREAD, \
113 .files = &init_files, \
114 .signal = &init_signals, \
115 .sighand = &init_sighand, \
117 .list = LIST_HEAD_INIT(tsk.pending.list), \
120 .alloc_lock = SPIN_LOCK_UNLOCKED, \
121 .proc_lock = SPIN_LOCK_UNLOCKED, \
122 .journal_info = NULL, \
123 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
124 .fs_excl = ATOMIC_INIT(0), \
128 #define INIT_CPU_TIMERS(cpu_timers) \
130 LIST_HEAD_INIT(cpu_timers[0]), \
131 LIST_HEAD_INIT(cpu_timers[1]), \
132 LIST_HEAD_INIT(cpu_timers[2]), \