Mercurial > hg > Members > kono > Cerium
annotate TaskManager/kernel/sys_task/TaskArray.cc @ 682:80b23718df18
test code for TaskArray
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 06 Dec 2009 18:13:46 +0900 |
parents | |
children | 9a6cb2439593 |
rev | line source |
---|---|
682 | 1 #include "Finish.h" |
2 #include "SysFunc.h" | |
3 #include "Scheduler.h" | |
4 #include "Task.h" | |
5 | |
6 | |
7 SchedDefineTask(TaskArray); | |
8 | |
9 static Task * | |
10 next(Task *t) | |
11 { | |
12 char *p = (char*)t; | |
13 p += t->size(); | |
14 return (Task*)p; | |
15 } | |
16 | |
17 static int | |
18 run(SchedTask *s,void *rbuf, void *wbuf) | |
19 { | |
20 Task *task = (Task *)rbuf; | |
21 Task *last = ((char*)rbuf)+ s->read_size(); | |
22 | |
23 while( task < last) { | |
24 task->print(s); | |
25 task = next(task); | |
26 } | |
27 | |
28 return 0; | |
29 } |