Changeset 91b60499 in mainline for kernel/generic/src/proc/task.c
- Timestamp:
- 2017-09-30T06:29:42Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 300f4c4
- Parents:
- d076f16 (diff), 6636fb19 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
rd076f16 r91b60499 50 50 #include <adt/btree.h> 51 51 #include <adt/list.h> 52 #include <cap/cap.h> 52 53 #include <ipc/ipc.h> 53 54 #include <ipc/ipcrsc.h> … … 83 84 static void task_kill_internal(task_t *); 84 85 static int tsk_constructor(void *, unsigned int); 86 static size_t tsk_destructor(void *obj); 85 87 86 88 /** Initialize kernel tasks support. … … 92 94 avltree_create(&tasks_tree); 93 95 task_slab = slab_cache_create("task_t", sizeof(task_t), 0, 94 tsk_constructor, NULL, 0);96 tsk_constructor, tsk_destructor, 0); 95 97 } 96 98 … … 167 169 list_initialize(&task->threads); 168 170 171 caps_task_alloc(task); 172 169 173 ipc_answerbox_init(&task->answerbox, task); 170 174 171 size_t i;172 for (i = 0; i < IPC_MAX_PHONES; i++)173 ipc_phone_init(&task->phones[i], task);174 175 175 spinlock_initialize(&task->active_calls_lock, "active_calls_lock"); 176 176 list_initialize(&task->active_calls); … … 186 186 } 187 187 188 size_t tsk_destructor(void *obj) 189 { 190 task_t *task = (task_t *) obj; 191 192 caps_task_free(task); 193 return 0; 194 } 195 188 196 /** Create new task with no threads. 189 197 * … … 206 214 task->ucycles = 0; 207 215 task->kcycles = 0; 216 217 caps_task_init(task); 208 218 209 219 task->ipc_info.call_sent = 0; … … 228 238 229 239 if ((ipc_phone_0) && 230 (container_check(ipc_phone_0->task->container, task->container))) 231 (void) ipc_phone_connect(&task->phones[0], ipc_phone_0); 240 (container_check(ipc_phone_0->task->container, task->container))) { 241 cap_handle_t phone_handle = phone_alloc(task); 242 kobject_t *phone_obj = kobject_get(task, phone_handle, 243 KOBJECT_TYPE_PHONE); 244 (void) ipc_phone_connect(phone_obj->phone, ipc_phone_0); 245 } 232 246 233 247 futex_task_init(task); … … 603 617 if (*additional) 604 618 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c " 605 "%9" PRIua , task->taskid, ucycles, usuffix, kcycles,619 "%9" PRIua "\n", task->taskid, ucycles, usuffix, kcycles, 606 620 ksuffix, atomic_get(&task->refcount)); 607 621 else … … 609 623 task->taskid, task->name, task->container, task, task->as); 610 624 #endif 611 612 if (*additional) {613 size_t i;614 for (i = 0; i < IPC_MAX_PHONES; i++) {615 if (task->phones[i].callee)616 printf(" %zu:%p", i, task->phones[i].callee);617 }618 printf("\n");619 }620 625 621 626 irq_spinlock_unlock(&task->lock, false);
Note:
See TracChangeset
for help on using the changeset viewer.