Rev 2105 | Rev 2216 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2105 | Rev 2106 | ||
|---|---|---|---|
| Line 56... | Line 56... | ||
| 56 | 56 | ||
| 57 | /** Task structure. */ |
57 | /** Task structure. */ |
| 58 | typedef struct task { |
58 | typedef struct task { |
| 59 | /** Task lock. |
59 | /** Task lock. |
| 60 | * |
60 | * |
| 61 | * Must be acquired before threads_lock and thread lock of any of its threads. |
61 | * Must be acquired before threads_lock and thread lock of any of its |
| - | 62 | * threads. |
|
| 62 | */ |
63 | */ |
| 63 | SPINLOCK_DECLARE(lock); |
64 | SPINLOCK_DECLARE(lock); |
| 64 | 65 | ||
| 65 | char *name; |
66 | char *name; |
| 66 | struct thread *main_thread; /**< Pointer to the main thread. */ |
67 | /** Pointer to the main thread. */ |
| - | 68 | struct thread *main_thread; |
|
| 67 | link_t th_head; /**< List of threads contained in this task. */ |
69 | /** List of threads contained in this task. */ |
| - | 70 | link_t th_head; |
|
| 68 | as_t *as; /**< Address space. */ |
71 | /** Address space. */ |
| - | 72 | as_t *as; |
|
| 69 | task_id_t taskid; /**< Unique identity of task */ |
73 | /** Unique identity of task. */ |
| - | 74 | task_id_t taskid; |
|
| 70 | context_id_t context; /**< Task security context */ |
75 | /** Task security context. */ |
| - | 76 | context_id_t context; |
|
| 71 | 77 | ||
| 72 | /** If this is true, new threads can become part of the task. */ |
78 | /** If this is true, new threads can become part of the task. */ |
| 73 | bool accept_new_threads; |
79 | bool accept_new_threads; |
| - | 80 | /** Number of references (i.e. threads). */ |
|
| - | 81 | count_t refcount; |
|
| 74 | 82 | ||
| 75 | count_t refcount; /**< Number of references (i.e. threads). */ |
83 | /** Task capabilities. */ |
| 76 | - | ||
| 77 | cap_t capabilities; /**< Task capabilities. */ |
84 | cap_t capabilities; |
| 78 | 85 | ||
| 79 | /* IPC stuff */ |
86 | /* IPC stuff */ |
| 80 | answerbox_t answerbox; /**< Communication endpoint */ |
87 | answerbox_t answerbox; /**< Communication endpoint */ |
| 81 | phone_t phones[IPC_MAX_PHONES]; |
88 | phone_t phones[IPC_MAX_PHONES]; |
| 82 | atomic_t active_calls; /**< Active asynchronous messages. |
- | |
| - | 89 | /** |
|
| 83 | * It is used for limiting uspace to |
90 | * Active asynchronous messages. It is used for limiting uspace to |
| 84 | * certain extent. */ |
91 | * certain extent. |
| - | 92 | */ |
|
| - | 93 | atomic_t active_calls; |
|
| 85 | 94 | ||
| 86 | task_arch_t arch; /**< Architecture specific task data. */ |
95 | /** Architecture specific task data. */ |
| - | 96 | task_arch_t arch; |
|
| 87 | 97 | ||
| 88 | /** |
98 | /** |
| 89 | * Serializes access to the B+tree of task's futexes. This mutex is |
99 | * Serializes access to the B+tree of task's futexes. This mutex is |
| 90 | * independent on the task spinlock. |
100 | * independent on the task spinlock. |
| 91 | */ |
101 | */ |
| 92 | mutex_t futexes_lock; |
102 | mutex_t futexes_lock; |
| 93 | btree_t futexes; /**< B+tree of futexes referenced by this task. */ |
103 | /** B+tree of futexes referenced by this task. */ |
| - | 104 | btree_t futexes; |
|
| 94 | 105 | ||
| 95 | uint64_t cycles; /**< Accumulated accounting. */ |
106 | /** Accumulated accounting. */ |
| - | 107 | uint64_t cycles; |
|
| 96 | } task_t; |
108 | } task_t; |
| 97 | 109 | ||
| 98 | SPINLOCK_EXTERN(tasks_lock); |
110 | SPINLOCK_EXTERN(tasks_lock); |
| 99 | extern btree_t tasks_btree; |
111 | extern btree_t tasks_btree; |
| 100 | 112 | ||