1 #ifndef _LINUX__INIT_TASK_H
2 #define _LINUX__INIT_TASK_H
4 #include <linux/file.h>
8 .count = ATOMIC_INIT(1), \
9 .file_lock = SPIN_LOCK_UNLOCKED, \
10 .max_fds = NR_OPEN_DEFAULT, \
11 .max_fdset = __FD_SETSIZE, \
13 .fd = &init_files.fd_array[0], \
14 .close_on_exec = &init_files.close_on_exec_init, \
15 .open_fds = &init_files.open_fds_init, \
16 .close_on_exec_init = { { 0, } }, \
17 .open_fds_init = { { 0, } }, \
18 .fd_array = { NULL, } \
21 #define INIT_KIOCTX(name, which_mm) \
23 .users = ATOMIC_INIT(1), \
28 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait), \
29 .ctx_lock = SPIN_LOCK_UNLOCKED, \
34 #define INIT_MM(name) \
37 .pgd = swapper_pg_dir, \
38 .mm_users = ATOMIC_INIT(2), \
39 .mm_count = ATOMIC_INIT(1), \
40 .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \
41 .page_table_lock = SPIN_LOCK_UNLOCKED, \
42 .mmlist = LIST_HEAD_INIT(name.mmlist), \
43 .cpu_vm_mask = CPU_MASK_ALL, \
44 .default_kioctx = INIT_KIOCTX(name.default_kioctx, name), \
47 #define INIT_SIGNALS(sig) { \
48 .count = ATOMIC_INIT(1), \
50 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
52 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
55 #define INIT_SIGHAND(sighand) { \
56 .count = ATOMIC_INIT(1), \
57 .action = { {{NULL,}}, }, \
58 .siglock = SPIN_LOCK_UNLOCKED, \
61 extern struct group_info init_groups
;
64 * INIT_TASK is used to set up the first task table, touch at
65 * your own risk!. Base=0, limit=0x1fffff (=2MB)
67 #define INIT_TASK(tsk) \
70 .thread_info = &init_thread_info, \
71 .usage = ATOMIC_INIT(2), \
74 .prio = MAX_PRIO-20, \
75 .static_prio = MAX_PRIO-20, \
76 .policy = SCHED_NORMAL, \
77 .cpus_allowed = CPU_MASK_ALL, \
79 .active_mm = &init_mm, \
80 .run_list = LIST_HEAD_INIT(tsk.run_list), \
82 .tasks = LIST_HEAD_INIT(tsk.tasks), \
83 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \
84 .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \
85 .real_parent = &tsk, \
87 .children = LIST_HEAD_INIT(tsk.children), \
88 .sibling = LIST_HEAD_INIT(tsk.sibling), \
89 .group_leader = &tsk, \
90 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\
92 .function = it_real_fn \
94 .group_info = &init_groups, \
95 .cap_effective = CAP_INIT_EFF_SET, \
96 .cap_inheritable = CAP_INIT_INH_SET, \
97 .cap_permitted = CAP_FULL_SET, \
98 .keep_capabilities = 0, \
99 .rlim = INIT_RLIMITS, \
102 .thread = INIT_THREAD, \
104 .files = &init_files, \
105 .signal = &init_signals, \
106 .sighand = &init_sighand, \
108 .list = LIST_HEAD_INIT(tsk.pending.list), \
111 .alloc_lock = SPIN_LOCK_UNLOCKED, \
112 .proc_lock = SPIN_LOCK_UNLOCKED, \
113 .switch_lock = SPIN_LOCK_UNLOCKED, \
114 .journal_info = NULL, \