annotate TaskManager/kernel/ppe/HTask.h @ 507:735f76483bb2

Reorganization..
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 12 Oct 2009 09:39:35 +0900
parents eacbcdb23986
children 2659376067e8 125a72948e44
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_HTASK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_HTASK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
307
7075842aa155 clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
4 #include "base.h"
7075842aa155 clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
5 #include "types.h"
7075842aa155 clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
6 #include "Task.h"
7075842aa155 clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
7 #include "TaskQueueInfo.h"
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 class TaskManagerImpl;
507
735f76483bb2 Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
10 class SchedTask;
735f76483bb2 Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
11
735f76483bb2 Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
12 typedef void (*PostFunction)(SchedTask *s, void *read, void *write);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
14 /*!
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
15 @class
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
16
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
17 @brief
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
18
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
19 Cerium の Task で、spawn() でキューに格納されて順次実行される。
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
20 cpu の指定があれば並列に実行される。
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
21 特定の Task を待ち合わせる事が可能。
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
22 Task の入出力は dma などで copy される。
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
23 */
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
24
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 class HTask : public Task {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26 public:
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 BASE_NEW_DELETE(HTask);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28
479
5bda98b0b56d 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
5bda98b0b56d 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
507
735f76483bb2 Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
31 PostFunction func;
735f76483bb2 Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
32 void *post_arg1;
735f76483bb2 Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
33 void *post_arg2;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 CPU_TYPE cpu_type;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 TaskManagerImpl *mimpl;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36
498
cb5ecfc5aaa3 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
37 HTask *waiter;
cb5ecfc5aaa3 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
38 HTask *next;
cb5ecfc5aaa3 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
39 HTask *prev;
cb5ecfc5aaa3 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
40
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 void spawn(void);
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
42 void wait_for(HTask *);
397
a4f690f44842 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);
507
735f76483bb2 Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
44 void set_post(PostFunction func, void *read, void *write);
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 };
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 typedef HTask* HTaskPtr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 #endif