Rev 822 | Rev 965 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 822 | Rev 955 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | 33 | ||
34 | #include <synch/spinlock.h> |
34 | #include <synch/spinlock.h> |
35 | #include <arch.h> |
35 | #include <arch.h> |
36 | #include <panic.h> |
36 | #include <panic.h> |
37 | #include <adt/list.h> |
37 | #include <adt/list.h> |
- | 38 | #include <ipc/ipc.h> |
|
- | 39 | #include <memstr.h> |
|
38 | 40 | ||
39 | SPINLOCK_INITIALIZE(tasks_lock); |
41 | SPINLOCK_INITIALIZE(tasks_lock); |
40 | LIST_INITIALIZE(tasks_head); |
42 | LIST_INITIALIZE(tasks_head); |
41 | 43 | ||
42 | /** Initialize tasks |
44 | /** Initialize tasks |
Line 68... | Line 70... | ||
68 | 70 | ||
69 | spinlock_initialize(&ta->lock, "task_ta_lock"); |
71 | spinlock_initialize(&ta->lock, "task_ta_lock"); |
70 | list_initialize(&ta->th_head); |
72 | list_initialize(&ta->th_head); |
71 | list_initialize(&ta->tasks_link); |
73 | list_initialize(&ta->tasks_link); |
72 | ta->as = as; |
74 | ta->as = as; |
- | 75 | ||
- | 76 | ipc_answerbox_init(&ta->answerbox); |
|
- | 77 | memsetb((__address)&ta->phones, sizeof(ta->phones[0])*IPC_MAX_PHONES, 0); |
|
- | 78 | if (ipc_central_box) |
|
- | 79 | ipc_phone_init(&ta->phones[0], ipc_central_box); |
|
73 | 80 | ||
74 | ipl = interrupts_disable(); |
81 | ipl = interrupts_disable(); |
75 | spinlock_lock(&tasks_lock); |
82 | spinlock_lock(&tasks_lock); |
76 | list_append(&ta->tasks_link, &tasks_head); |
83 | list_append(&ta->tasks_link, &tasks_head); |
77 | spinlock_unlock(&tasks_lock); |
84 | spinlock_unlock(&tasks_lock); |