annotate TaskManager/kernel/ppe/HTask.h @ 688:77c89477daa8 draft

on going...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 06 Dec 2009 18:53:46 +0900
parents 25afcd4ae380
children ecf63089f5bb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_HTASK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_HTASK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
307
3fc86ddf5d1c clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
4 #include "base.h"
3fc86ddf5d1c clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
5 #include "types.h"
3fc86ddf5d1c clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
6 #include "Task.h"
3fc86ddf5d1c clean up include
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
7 #include "TaskQueueInfo.h"
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 class TaskManagerImpl;
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
10 class SchedTask;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
11
547
e5431e658038 continue..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 546
diff changeset
12 typedef void (*PostFunction)(SchedTask *s, void *read, void *write);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
14 /*!
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
15 @class
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
16
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
17 @brief
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
18
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
19 Cerium の Task で、spawn() でキューに格納されて順次実行される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
20 cpu の指定があれば並列に実行される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
21 特定の Task を待ち合わせる事が可能。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
22 Task の入出力は dma などで copy される。
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
23 */
688
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
24 #ifdef SIMPLE_TASK
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
25
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
26 #include "SimpleTask.h"
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
27
641
0605f27ba7d9 Regression on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
28 class HTask : public SimpleTask {
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 571
diff changeset
29 #else
641
0605f27ba7d9 Regression on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 634
diff changeset
30 class HTask : public Task {
634
62e570ac5db2 SimpleTask start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 571
diff changeset
31 #endif
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32 public:
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 BASE_NEW_DELETE(HTask);
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34
479
bf2d2625485e Double Linked List base TaskQueue
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 397
diff changeset
35 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
36 TaskQueueInfo *wait_i; // List of task for which I am waiting
546
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 539
diff changeset
37 PostFunction post_func;
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
38 void *post_arg1;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
39 void *post_arg2;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40 CPU_TYPE cpu_type;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 TaskManagerImpl *mimpl;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42
498
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
43 HTask *waiter;
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
44 HTask *next;
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
45 HTask *prev;
bce667ff20b9 double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
46
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 void spawn(void);
293
da8edd0735f2 add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
48 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
49 void set_cpu(CPU_TYPE type);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 499
diff changeset
50 void set_post(PostFunction func, void *read, void *write);
688
77c89477daa8 on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 687
diff changeset
51 #ifdef SIMPLE_TASK
687
25afcd4ae380 test code for TaskArray
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 684
diff changeset
52 Task *create_task(int task_id, int pos);
684
ecf7e09b1fe8 adding Array Task.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 641
diff changeset
53 #endif
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
54 };
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
55
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
56 typedef HTask* HTaskPtr;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
57
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
58 #endif