annotate TaskManager/Fifo/FifoTaskManagerImpl.cc @ 194:72dcf908ec52

fix
author gongo@localhost.localdomain
date Tue, 20 Jan 2009 14:50:41 +0900 (2009-01-20)
parents 5c194c71eca8
children 58fd16298954
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
1 #include <stdio.h>
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
2 #include <stdlib.h>
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
3 #include <string.h>
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
4 #include "FifoTaskManagerImpl.h"
47
8266445bdac2 *** empty log message ***
gongo
parents: 42
diff changeset
5 #include "types.h"
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
6 #include "error.h"
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
7
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
8 FifoTaskManagerImpl::~FifoTaskManagerImpl(void)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
9 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
10 delete mailManager;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
11 delete scheduler;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
12 delete bufferManager;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
13 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
14
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
15 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
16 * MailManager �� PPE �������塼��ȤΥ᡼��򴹡�
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
17 * FifoScheduler �� PPE ¦�Υ������塼��
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
18 * BufferManager �� Task��TaskList �ʤɤΥ������(���ؤʤ��Ȥ��Ƥʤ���
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
19 */
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
20 void
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
21 FifoTaskManagerImpl::init(void)
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
22 {
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
23 mailManager = new MailManager();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
24 mailManager->init(20);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
25
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
26 scheduler = new MainScheduler();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
27 scheduler->init();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
28 scheduler->set_mailManager(mailManager);
194
gongo@localhost.localdomain
parents: 109
diff changeset
29 scheduler->id = 0;
42
aa11038dbdc1 *** empty log message ***
gongo
parents: 22
diff changeset
30
58
7492eb28b577 *** empty log message ***
gongo
parents: 47
diff changeset
31 bufferManager = new BufferManager;
7492eb28b577 *** empty log message ***
gongo
parents: 47
diff changeset
32 bufferManager->init();
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
33
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
34 mainTaskList = bufferManager->create_taskList();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
35 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
36
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
37 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
38 * ����� CellTaskManagerImpl ����ƤФ�롣
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
39 * BufferManager �϶��ѤǻȤ��Τǰ����ˡ�
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
40 * CellTaskManagerImpl �� FifoTaskManagerImpl ��Ʊ����
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
41 * ��Υǡ����˥��������������(����)�ʤ��ΤǤ���Ǥ�k
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
42 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
43 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
44 FifoTaskManagerImpl::init(MainScheduler *_sched, BufferManager *buff)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
45 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
46 mailManager = new MailManager();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
47 mailManager->init(20);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
48
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
49 //scheduler = new MainScheduler();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
50 scheduler = _sched;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
51 scheduler->init();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
52 scheduler->set_mailManager(mailManager);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
53
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
54 bufferManager = buff;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
55
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
56 mainTaskList = bufferManager->create_taskList();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
57 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
58
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
59 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
60 * �������塼����Ϥ� TaskList ��������롣
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
61 *
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
62 * @return �¹ԥ������ꥹ��
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
63 *
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
64 * ActiveTaskQueue (��¸�����������Ѥ�) �Υ�������
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
65 * �¹ԥ������ꥹ�Ȥ������
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
66 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
67 TaskListPtr
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
68 FifoTaskManagerImpl::get_runTaskList(void)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
69 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
70 TaskListPtr list, list_top;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
71 TaskQueuePtr queue;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
72 TaskQueuePtr d;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
73 HTaskPtr htask; // HTask (PPE �ˤ���)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
74 TaskPtr task; // Task (SPE ������ Task)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
75
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
76 queue = activeTaskQueue;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
77 if (queue == NULL) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
78 return NULL;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
79 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
80
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
81 // PPE ¦�Ǽ¹Ԥ���� TaskList
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
82 list_top = mainTaskList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
83
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
84 // list_top->clear() �Ȥ��������������⤷���
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
85 list_top = bufferManager->clear_taskList(list_top);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
86 list = list_top;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
87
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
88 while (queue) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
89 htask = (HTaskPtr)queue->task;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
90 d = queue;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
91 queue = queue->next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
92
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
93 task = &list->tasks[list->length++];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
94
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
95 #if 0
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
96 task->command = htask->command;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
97 task->inData = htask->inData;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
98 task->outData = htask->outData;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
99 task->self = (unsigned int)htask;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
100 #else
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
101 memcpy(task, htask, sizeof(Task));
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
102 #endif
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
103
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
104 if (list->length >= TASK_MAX_SIZE) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
105 TaskListPtr newList = bufferManager->create_taskList();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
106 list_top = TaskListInfo::append(list_top, newList);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
107 list = newList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
108 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
110 bufferManager->free_taskQueue(d);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
111 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
112
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
113 activeTaskQueue = NULL;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
114 mainTaskList = list_top;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
115
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
116 return list_top;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
117 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
118
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
119
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
120 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
121 FifoTaskManagerImpl::run(void)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
122 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
123 TaskListPtr list;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
124 MailQueuePtr mail;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
125
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
126 list = get_runTaskList();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
127
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
128 do {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
129 // list ��¹Ԥ���
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
130 mail = schedule(list);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
131
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
132 // mail �ˤϡ�ppe scheduler ����� mail ������
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
133 mail_check(mail);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
134
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
135 // ��¸�ط�������������Τϼ¹Բ�ǽ���塼��
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
136 wakeup_waitTask();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
137 list = get_runTaskList();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
138 } while (list);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
139 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
140
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
141 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
142 * @param [list] �¹ԥ������ꥹ��
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
143 * @return FifoScheduler ����Υ᡼��
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
144 *
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
145 * [Tasklist] -> [��ʼ] -> scheduler->run ��ȴ����
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
146 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
147 MailQueuePtr
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
148 FifoTaskManagerImpl::schedule(TaskListPtr list)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
149 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
150 MailQueuePtr list_mail; // task list
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
151 MailQueuePtr sentinel; // ��ʼ
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
152 MailQueuePtr in_mail_list = NULL;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
153 MailQueuePtr out_mail_list = NULL;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
154
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
155 // TaskList �Υ��ɥ쥹
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
156 list_mail = mailManager->create((unsigned int)list);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
157 in_mail_list = MailManager::append_mailQueue(in_mail_list, list_mail);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
158
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
159 // EXIT_COMMAND (��ʼŪ�ʰ�̣��)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
160 sentinel = mailManager->create(MY_SPE_COMMAND_EXIT);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
161 in_mail_list = MailManager::append_mailQueue(in_mail_list, sentinel);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
162
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
163 // scheduler �ϼ�����ä��᡼��򸵤˼¹Ԥ���
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
164 scheduler->send_mailList(in_mail_list);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
165 scheduler->run();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
166 out_mail_list = scheduler->recv_mailList();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
167
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
168 return out_mail_list;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
169 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
170
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
171 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
172 * PPE Scheduler ����Υ᡼�������å�����
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
173 *
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
174 * @param [mail_list]
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
175 * PPE ¦��ư�� Scheduler ����Υ᡼��ꥹ��
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
176 * ��λ���� Task �䡢����¾(���Ϥޤ��������Ƥʤ�����)�ξ������äƤ�
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
177 *
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
178 * @return Scheduler �����˼¹Ԥ��� Task List
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
179 * NULL �ʤ����ƤΥ��������¹Խ�λ�����Ȥ�������
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
180 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
181 void
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
182 FifoTaskManagerImpl::mail_check(MailQueuePtr mail_list)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
183 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
184 MailQueuePtr q = mail_list;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
185 MailQueuePtr d;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
186 unsigned int data;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
187
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
188 while (q) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
189 data = q->data;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
190
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
191 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
192 * MY_SPE_STATUS_READY: SPE �����äƤ� Task ���ƽ�λ
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
193 * MY_SPE_NOP: �ä˰�̣�Τʤ����ޥ��
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
194 * ����ʳ�����λ����������(PPE�ˤ���Τǥ��ɥ쥹
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
195 *
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
196 * MY_SPE_NOP �� 0 �ʤΤǡ�
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
197 * ���Τ褦�� data > MY_SPE_NOP �Ȥ����Ƥ��ޤ���
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
198 * ���ܤǤ褯�狼��ʤ������ʤ�ǡ�ľ�������Ȥ����Ǥ���������
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
199 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
200 if (data == MY_SPE_STATUS_READY) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
201 __debug_ppe("mail_check(): Task List finish\n");
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
202 } else if (data > MY_SPE_NOP) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
203 __debug_ppe("mail_check(): recv from 0x%x\n", data);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
204 check_task_finish((HTaskPtr)data);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
205 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
206
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
207 d = q;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
208 q = q->next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
209
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
210 mailManager->free(d);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
211 }
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
212 }
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
213
14
41ccd4b38184 *** empty log message ***
gongo
parents: 10
diff changeset
214 void
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
215 FifoTaskManagerImpl::mail_check(MailQueuePtr mail_list, TaskQueuePtr *wait)
14
41ccd4b38184 *** empty log message ***
gongo
parents: 10
diff changeset
216 {
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
217 waitTaskQueue = *wait;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
218 mail_check(mail_list);
14
41ccd4b38184 *** empty log message ***
gongo
parents: 10
diff changeset
219 }
41ccd4b38184 *** empty log message ***
gongo
parents: 10
diff changeset
220
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
221 void*
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
222 FifoTaskManagerImpl::allocate(int size)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
223 {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
224 return malloc(size);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
225 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
226
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
227 /**
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
228 * ���������Ȥ�����
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
229 * Abstract Factory Pattern
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
230 * �Ȥ����餷����
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
231 */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
232 #ifdef __CERIUM_FIFO__
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
233 TaskManagerImpl*
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
234 create_impl(int num)
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
235 {
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
236 return new FifoTaskManagerImpl();
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
237 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
238 #endif // __CERIUM_FIFO__