Rev 998 | Rev 1025 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 998 | Rev 1005 | ||
|---|---|---|---|
| Line 42... | Line 42... | ||
| 42 | 42 | ||
| 43 | #include <elf.h> |
43 | #include <elf.h> |
| 44 | 44 | ||
| 45 | SPINLOCK_INITIALIZE(tasks_lock); |
45 | SPINLOCK_INITIALIZE(tasks_lock); |
| 46 | LIST_INITIALIZE(tasks_head); |
46 | LIST_INITIALIZE(tasks_head); |
| - | 47 | static task_id_t task_counter = 0; |
|
| 47 | 48 | ||
| 48 | /** Initialize tasks |
49 | /** Initialize tasks |
| 49 | * |
50 | * |
| 50 | * Initialize kernel tasks support. |
51 | * Initialize kernel tasks support. |
| 51 | * |
52 | * |
| Line 83... | Line 84... | ||
| 83 | ipc_phone_init(&ta->phones[0], ipc_phone_0); |
84 | ipc_phone_init(&ta->phones[0], ipc_phone_0); |
| 84 | atomic_set(&ta->active_calls, 0); |
85 | atomic_set(&ta->active_calls, 0); |
| 85 | 86 | ||
| 86 | ipl = interrupts_disable(); |
87 | ipl = interrupts_disable(); |
| 87 | spinlock_lock(&tasks_lock); |
88 | spinlock_lock(&tasks_lock); |
| - | 89 | ||
| - | 90 | ta->taskid = ++task_counter; |
|
| 88 | list_append(&ta->tasks_link, &tasks_head); |
91 | list_append(&ta->tasks_link, &tasks_head); |
| - | 92 | ||
| 89 | spinlock_unlock(&tasks_lock); |
93 | spinlock_unlock(&tasks_lock); |
| 90 | interrupts_restore(ipl); |
94 | interrupts_restore(ipl); |
| 91 | 95 | ||
| 92 | return ta; |
96 | return ta; |
| 93 | } |
97 | } |