Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/ppe/HTask.h @ 571:fd3789d17305 draft
merge
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 23 Oct 2009 00:16:38 +0900 |
parents | fbcbcc5ad3b5 9f23e9d4973f |
children | 62e570ac5db2 |
rev | line source |
---|---|
109 | 1 #ifndef INCLUDED_HTASK |
2 #define INCLUDED_HTASK | |
3 | |
307 | 4 #include "base.h" |
5 #include "types.h" | |
6 #include "Task.h" | |
7 #include "TaskQueueInfo.h" | |
109 | 8 |
9 class TaskManagerImpl; | |
539 | 10 class SchedTask; |
11 | |
547 | 12 typedef void (*PostFunction)(SchedTask *s, void *read, void *write); |
109 | 13 |
293 | 14 /*! |
15 @class | |
16 | |
17 @brief | |
18 | |
19 Cerium の Task で、spawn() でキューに格納されて順次実行される。 | |
20 cpu の指定があれば並列に実行される。 | |
21 特定の Task を待ち合わせる事が可能。 | |
22 Task の入出力は dma などで copy される。 | |
23 */ | |
24 | |
109 | 25 class HTask : public Task { |
26 public: | |
27 BASE_NEW_DELETE(HTask); | |
28 | |
479
bf2d2625485e
Double Linked List base TaskQueue
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
397
diff
changeset
|
29 TaskQueueInfo *wait_me; // List of task waiting for me |
bf2d2625485e
Double Linked List base TaskQueue
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
397
diff
changeset
|
30 TaskQueueInfo *wait_i; // List of task for which I am waiting |
546 | 31 PostFunction post_func; |
539 | 32 void *post_arg1; |
33 void *post_arg2; | |
109 | 34 CPU_TYPE cpu_type; |
35 TaskManagerImpl *mimpl; | |
36 | |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
480
diff
changeset
|
37 HTask *waiter; |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
480
diff
changeset
|
38 HTask *next; |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
480
diff
changeset
|
39 HTask *prev; |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
480
diff
changeset
|
40 |
109 | 41 void spawn(void); |
293 | 42 void wait_for(HTask *); |
397
ce86b0186a4a
delete manager (in kernel/ppe/TaskManager.h)
game@henri.cr.ie.u-ryukyu.ac.jp
parents:
366
diff
changeset
|
43 void set_cpu(CPU_TYPE type); |
539 | 44 void set_post(PostFunction func, void *read, void *write); |
109 | 45 }; |
46 | |
47 typedef HTask* HTaskPtr; | |
48 | |
49 #endif |