Mercurial > hg > Members > kono > Cerium
annotate TaskManager/kernel/schedule/SchedTaskList.cc @ 625:60aa3f241b10
64bit mode worked on Mac OS X.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Nov 2009 10:59:55 +0900 |
parents | 0decff4e867b |
children | 9a6cb2439593 |
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 return sched; | |
23 } | |
24 | |
625
60aa3f241b10
64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
619
diff
changeset
|
25 SchedTaskList::SchedTaskList(memaddr addr, Scheduler *sched) |
42 | 26 { |
27 params_addr = addr; | |
184 | 28 list = NULL; |
109 | 29 scheduler = sched; |
30 | |
42 | 31 } |
32 | |
109 | 33 |
42 | 34 void |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
35 SchedTaskList::read() |
42 | 36 { |
37 __debug("[SchedTaskList:%s]\n", __FUNCTION__); | |
38 | |
184 | 39 list = scheduler->get_curListBuf(); |
40 scheduler->dma_load(list, params_addr, | |
41 sizeof(TaskList), DMA_READ_TASKLIST); | |
42 | 42 } |
43 | |
44 SchedTaskBase* | |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
45 SchedTaskList::next(Scheduler *scheduler, SchedTaskBase *p) |
42 | 46 { |
184 | 47 SchedTaskBase *nextSched; |
48 | |
42 | 49 __debug("[SchedTaskList:%s]\n", __FUNCTION__); |
50 | |
233 | 51 scheduler->dma_wait(DMA_READ_TASKLIST); |
42 | 52 if (list->length < 1) { |
184 | 53 nextSched = new SchedNop2Ready(scheduler); |
42 | 54 } else { |
184 | 55 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
|
56 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
|
57 ((SchedTask*)nextSched)->init(list, nextTask, 1, |
184 | 58 scheduler); |
42 | 59 } |
184 | 60 |
61 return nextSched; | |
42 | 62 } |
88 | 63 |
403
8611780d479f
clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
233
diff
changeset
|
64 /* end */ |