Mercurial > hg > Members > kono > Cerium
annotate TaskManager/kernel/schedule/SchedTaskList.cc @ 619:0decff4e867b
RenewTask removal
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Nov 2009 02:02:30 +0900 |
parents | 42c94f85c779 |
children | 60aa3f241b10 |
rev | line source |
---|---|
109 | 1 #include <stdlib.h> |
2 #include <string.h> | |
42 | 3 #include "SchedTaskList.h" |
4 #include "SchedTask.h" | |
5 #include "SchedNop2Ready.h" | |
6 #include "DmaManager.h" | |
7 #include "error.h" | |
8 | |
184 | 9 /** |
10 * SchedTaskList を返す | |
11 * | |
12 * @param[in] next_list 次の実行する TaskList のアドレス | |
13 * @param[in] next_list がメインメモリのアドレスか、 | |
14 * SPE で生成されたアドレスかのフラグ | |
15 * SPE で生成されている場合、DMA の必要は無い | |
16 * 0: メインメモリ, 1: SPE | |
17 */ | |
18 SchedTaskList* | |
603
42c94f85c779
long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
602
diff
changeset
|
19 createSchedTaskList(memaddr next_list, Scheduler* scheduler, int renew_flag) |
184 | 20 { |
21 SchedTaskList* sched = new SchedTaskList(next_list, scheduler); | |
22 sched->flag_renewTaskList = renew_flag; | |
23 return sched; | |
24 } | |
25 | |
109 | 26 SchedTaskList::SchedTaskList(unsigned int addr, Scheduler *sched) |
42 | 27 { |
28 params_addr = addr; | |
184 | 29 list = NULL; |
109 | 30 scheduler = sched; |
31 | |
32 flag_renewTaskList = 0; | |
42 | 33 } |
34 | |
109 | 35 |
42 | 36 void |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
37 SchedTaskList::read() |
42 | 38 { |
39 __debug("[SchedTaskList:%s]\n", __FUNCTION__); | |
40 | |
184 | 41 if (flag_renewTaskList == SCHED_TASKLIST_NORMAL) { |
42 list = scheduler->get_curListBuf(); | |
43 scheduler->dma_load(list, params_addr, | |
44 sizeof(TaskList), DMA_READ_TASKLIST); | |
109 | 45 } else { |
46 list = (TaskListPtr)params_addr; | |
47 } | |
42 | 48 } |
49 | |
50 SchedTaskBase* | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
51 SchedTaskList::next(Scheduler *scheduler, SchedTaskBase *p) |
42 | 52 { |
184 | 53 SchedTaskBase *nextSched; |
54 | |
42 | 55 __debug("[SchedTaskList:%s]\n", __FUNCTION__); |
56 | |
233 | 57 scheduler->dma_wait(DMA_READ_TASKLIST); |
42 | 58 if (list->length < 1) { |
184 | 59 nextSched = new SchedNop2Ready(scheduler); |
60 | |
61 if (flag_renewTaskList == SCHED_TASKLIST_RENEW) { | |
62 free(list); | |
63 } | |
64 | |
42 | 65 } else { |
184 | 66 TaskPtr nextTask = &list->tasks[0]; |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
67 nextSched = createSchedTask(scheduler, nextTask); |
483
0b933bef0328
renew task worked. but not test_nogl...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
439
diff
changeset
|
68 ((SchedTask*)nextSched)->init(list, nextTask, 1, |
184 | 69 scheduler); |
42 | 70 } |
184 | 71 |
72 return nextSched; | |
42 | 73 } |
88 | 74 |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
75 /* end */ |