Rev 35 | Rev 413 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 35 | Rev 107 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | #include <list.h> |
37 | #include <list.h> |
38 | 38 | ||
39 | spinlock_t tasks_lock; |
39 | spinlock_t tasks_lock; |
40 | link_t tasks_head; |
40 | link_t tasks_head; |
41 | 41 | ||
- | 42 | ||
- | 43 | /** Initialize tasks |
|
- | 44 | * |
|
- | 45 | * Initialize kernel tasks support. |
|
- | 46 | * |
|
- | 47 | */ |
|
42 | void task_init(void) |
48 | void task_init(void) |
43 | { |
49 | { |
44 | TASK = NULL; |
50 | TASK = NULL; |
45 | spinlock_initialize(&tasks_lock); |
51 | spinlock_initialize(&tasks_lock); |
46 | list_initialize(&tasks_head); |
52 | list_initialize(&tasks_head); |
47 | } |
53 | } |
48 | 54 | ||
- | 55 | ||
- | 56 | /** Create new task |
|
- | 57 | * |
|
- | 58 | * Create new task with no threads. |
|
- | 59 | * |
|
- | 60 | * @param m Task's virtual memory structure. |
|
- | 61 | * |
|
- | 62 | * @return New task's structure on success, NULL on failure. |
|
- | 63 | * |
|
- | 64 | */ |
|
49 | task_t *task_create(vm_t *m) |
65 | task_t *task_create(vm_t *m) |
50 | { |
66 | { |
51 | pri_t pri; |
67 | pri_t pri; |
52 | task_t *ta; |
68 | task_t *ta; |
53 | 69 |