annotate TaskManager/kernel/ppe/HTask.cc @ 364:87462f8d3761

uint32 to memaddr(uint64)
author tkaito@localhost.localdomain
date Fri, 24 Jul 2009 17:40:53 +0900
parents b89ba1d96fff
children a4f690f44842
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 #include "HTask.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include "ListData.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include "TaskManagerImpl.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
6 /*!
297
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
7 manager->set_task_depend(task1, task2); // task2 は task1 の終了を待つ
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
8
297
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
9 ってやるより
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
10
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
11 task2->set_depend(task1);
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
12
297
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
13 ってやったほうがわかりやすいよねー的な話し合いで
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
14 下のようなAPIを作りました
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
15 */
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
16
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 HTask::spawn(void)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 mimpl->spawn_task(this);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
23 /*!
297
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
24 @brief この Task が待ち合わせする Task を指定する
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
25 @param[in] master この Task が終了待ち合わせをする相手の Task
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
26
297
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
27 繰り返し使用する事で複数の Task を待ち合わせする事ができる。
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
28
297
f8006660a45c start task config
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 293
diff changeset
29 wait_for している Task の入力バッファにこの Task から書き込みできる機能があると良い
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
30 */
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
31
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32 void
293
9f4f99d459aa add wait_for document
e065746@localhost.localdomain
parents: 109
diff changeset
33 HTask::wait_for(HTaskPtr master)
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 mimpl->set_task_depend(master, this);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 HTask::set_cpu(CPU_TYPE type)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 mimpl->set_task_cpu(this, type);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 HTask::set_post(void (*func)(void *), void *arg)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 this->post_func = func;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48 this->post_arg = arg;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 }