annotate TaskManager/kernel/sys_task/TaskArray.cc @ 683:9a6cb2439593

on going...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 06 Dec 2009 18:53:46 +0900
parents 80b23718df18
children 458a1ad91427
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
682
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "Finish.h"
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include "SysFunc.h"
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include "Scheduler.h"
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "Task.h"
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 SchedDefineTask(TaskArray);
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 682
diff changeset
9 #ifdef SIMPLE_TASK
682
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 static Task *
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 next(Task *t)
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 {
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 char *p = (char*)t;
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 p += t->size();
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 return (Task*)p;
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 }
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 682
diff changeset
17 #endif
682
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 static int
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 run(SchedTask *s,void *rbuf, void *wbuf)
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 {
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 682
diff changeset
22 #ifdef SIMPLE_TASK
682
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 Task *task = (Task *)rbuf;
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 682
diff changeset
24 Task *last = (Task*)(((char*)rbuf)+ s->read_size());
682
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 while( task < last) {
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 682
diff changeset
27 task->print();
682
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 task = next(task);
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 }
683
9a6cb2439593 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 682
diff changeset
30 #endif
682
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 return 0;
80b23718df18 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 }