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, \
67 #define INIT_SIGHAND(sighand) { \
68 .count = ATOMIC_INIT(1), \
69 .action = { { { .sa_handler = NULL, } }, }, \
70 .siglock = SPIN_LOCK_UNLOCKED, \
73 extern struct group_info init_groups;
76 * INIT_TASK is used to set up the first task table, touch at
77 * your own risk!. Base=0, limit=0x1fffff (=2MB)
79 #define INIT_TASK(tsk) \
82 .thread_info = &init_thread_info, \
83 .usage = ATOMIC_INIT(2), \
86 .prio = MAX_PRIO-20, \
87 .static_prio = MAX_PRIO-20, \
88 .policy = SCHED_NORMAL, \
89 .cpus_allowed = CPU_MASK_ALL, \
91 .active_mm = &init_mm, \
92 .run_list = LIST_HEAD_INIT(tsk.run_list), \
95 .tasks = LIST_HEAD_INIT(tsk.tasks), \
96 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \
97 .ptrace_list = LIST_HEAD_INIT(tsk.ptrace_list), \
98 .real_parent = &tsk, \
100 .children = LIST_HEAD_INIT(tsk.children), \
101 .sibling = LIST_HEAD_INIT(tsk.sibling), \
102 .group_leader = &tsk, \
103 .group_info = &init_groups, \
104 .cap_effective = CAP_INIT_EFF_SET, \
105 .cap_inheritable = CAP_INIT_INH_SET, \
106 .cap_permitted = CAP_FULL_SET, \
107 .keep_capabilities = 0, \
110 .thread = INIT_THREAD, \
112 .files = &init_files, \
113 .signal = &init_signals, \
114 .sighand = &init_sighand, \
116 .list = LIST_HEAD_INIT(tsk.pending.list), \
119 .alloc_lock = SPIN_LOCK_UNLOCKED, \
120 .proc_lock = SPIN_LOCK_UNLOCKED, \
121 .journal_info = NULL, \
122 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
123 .fs_excl = ATOMIC_INIT(0), \
127 #define INIT_CPU_TIMERS(cpu_timers) \
129 LIST_HEAD_INIT(cpu_timers[0]), \
130 LIST_HEAD_INIT(cpu_timers[1]), \
131 LIST_HEAD_INIT(cpu_timers[2]), \