annotate TaskManager/kernel/schedule/SchedTaskList.cc @ 683:9a6cb2439593

on going...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 06 Dec 2009 18:53:46 +0900
parents 60aa3f241b10
children 6d497c098455
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
1 #include <stdlib.h>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
2 #include <string.h>
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
3 #include "SchedTaskList.h"
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
4 #include "SchedTask.h"
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
5 #include "SchedNop2Ready.h"
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
6 #include "DmaManager.h"
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
7 #include "error.h"
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
8
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
9 /**
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
10 * SchedTaskList を返す
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
11 *
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
12 * @param[in] next_list 次の実行する TaskList のアドレス
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
13 * @param[in] next_list がメインメモリのアドレスか、
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
14 * SPE で生成されたアドレスかのフラグ
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
15 * SPE で生成されている場合、DMA の必要は無い
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
16 * 0: メインメモリ, 1: SPE
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
17 */
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
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
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
20 {
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
21 SchedTaskList* sched = new SchedTaskList(next_list, scheduler);
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
22 return sched;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
23 }
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
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
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
26 {
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
27 params_addr = addr;
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
28 list = NULL;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
29 scheduler = sched;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
30
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
31 }
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
32
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 88
diff changeset
33
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
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
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
36 {
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
37 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
38
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
39 list = scheduler->get_curListBuf();
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
40 scheduler->dma_load(list, params_addr,
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
41 sizeof(TaskList), DMA_READ_TASKLIST);
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
42 }
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
43
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
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
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
46 {
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
47 SchedTaskBase *nextSched;
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
48
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
49 __debug("[SchedTaskList:%s]\n", __FUNCTION__);
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
50
233
gongo@localhost.localdomain
parents: 184
diff changeset
51 scheduler->dma_wait(DMA_READ_TASKLIST);
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
52 if (list->length < 1) {
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
53 nextSched = new SchedNop2Ready(scheduler);
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
54 } else {
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
55 #ifdef SIMPLE_TASK
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
56 SimpleTaskPtr nextTask = &list->tasks[0];
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
57 #else
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
58 TaskPtr nextTask = &list->tasks[0];
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 625
diff changeset
59 #endif
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 233
diff changeset
60 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
61 ((SchedTask*)nextSched)->init(list, nextTask, 1,
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
62 scheduler);
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
63 }
184
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
64
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
65 return nextSched;
42
aa11038dbdc1 *** empty log message ***
gongo
parents:
diff changeset
66 }
88
504899860e66 *** empty log message ***
gongo
parents: 42
diff changeset
67
403
8611780d479f clean up and add more info on task_list
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 233
diff changeset
68 /* end */