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 = EMBEDDED_FD_SET_SIZE, \
11 .fd = &init_files.fd_array[0], \
12 .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \
13 .open_fds = (fd_set *)&init_files.open_fds_init, \
14 .rcu = RCU_HEAD_INIT, \
21 .count = ATOMIC_INIT(1), \
22 .fdt = &init_files.fdtab, \
23 .fdtab = INIT_FDTABLE, \
24 .file_lock = SPIN_LOCK_UNLOCKED, \
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, \
56 #define INIT_SIGNALS(sig) { \
57 .count = ATOMIC_INIT(1), \
58 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
60 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
62 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
63 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
64 .rlim = INIT_RLIMITS, \
69 #define INIT_SIGHAND(sighand) { \
70 .count = ATOMIC_INIT(1), \
71 .action = { { { .sa_handler = NULL, } }, }, \
72 .siglock = SPIN_LOCK_UNLOCKED, \
75 extern struct group_info init_groups
;
78 * INIT_TASK is used to set up the first task table, touch at
79 * your own risk!. Base=0, limit=0x1fffff (=2MB)
81 #define INIT_TASK(tsk) \
84 .thread_info = &init_thread_info, \
85 .usage = ATOMIC_INIT(2), \
88 .prio = MAX_PRIO-20, \
89 .static_prio = MAX_PRIO-20, \
90 .policy = SCHED_NORMAL, \
91 .cpus_allowed = CPU_MASK_ALL, \
93 .active_mm = &init_mm, \
94 .run_list = LIST_HEAD_INIT(tsk.run_list), \
97 .tasks = LIST_HEAD_INIT(tsk.tasks), \
98 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \
99 .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \
100 .real_parent = &tsk, \
102 .children = LIST_HEAD_INIT(tsk.children), \
103 .sibling = LIST_HEAD_INIT(tsk.sibling), \
104 .group_leader = &tsk, \
105 .group_info = &init_groups, \
106 .cap_effective = CAP_INIT_EFF_SET, \
107 .cap_inheritable = CAP_INIT_INH_SET, \
108 .cap_permitted = CAP_FULL_SET, \
109 .keep_capabilities = 0, \
112 .thread = INIT_THREAD, \
114 .files = &init_files, \
115 .signal = &init_signals, \
116 .sighand = &init_sighand, \
118 .list = LIST_HEAD_INIT(tsk.pending.list), \
121 .alloc_lock = SPIN_LOCK_UNLOCKED, \
122 .proc_lock = SPIN_LOCK_UNLOCKED, \
123 .journal_info = NULL, \
124 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
125 .fs_excl = ATOMIC_INIT(0), \
129 #define INIT_CPU_TIMERS(cpu_timers) \
131 LIST_HEAD_INIT(cpu_timers[0]), \
132 LIST_HEAD_INIT(cpu_timers[1]), \
133 LIST_HEAD_INIT(cpu_timers[2]), \