annotate TaskManager/kernel/spe/SpeTaskList.cc @ 31:6a77b5e755ab

*** empty log message ***
author gongo
date Tue, 12 Feb 2008 13:56:54 +0900
parents 7aa4c006e4be
children
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 "SpeTaskList.h"
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
3 #include "SpeTask.h"
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
4 #include "SpeNop2Ready.h"
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
5 #include "DmaManager.h"
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
6 #include "error.h"
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
7
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
8 SpeTaskList::SpeTaskList(unsigned int addr, TaskListPtr listbuf, DmaManager* c)
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
9 {
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
10 params_addr = addr;
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
11 list = listbuf;
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
12 connector = c;
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
13 }
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
14
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
15 void
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
16 SpeTaskList::read(void)
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
17 {
31
6a77b5e755ab *** empty log message ***
gongo
parents: 10
diff changeset
18 __debug("[SpeTaskList:%s]\n", __FUNCTION__);
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
19
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
20 connector->dma_load(list, params_addr, sizeof(TaskList), DMA_READ);
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
21 connector->dma_wait(DMA_READ);
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
22 }
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
23
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
24 SpeTaskBase*
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
25 SpeTaskList::next(SpeManager *m, SpeTaskBase *p)
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
26 {
31
6a77b5e755ab *** empty log message ***
gongo
parents: 10
diff changeset
27 __debug("[SpeTaskList:%s]\n", __FUNCTION__);
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
28
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
29 delete p;
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
30
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
31 if (list->length < 1) {
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
32 return new SpeNop2Ready(connector);
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
33 } else {
10
7aa4c006e4be *** empty log message ***
gongo
parents: 3
diff changeset
34 // 本当は、ここで task->command に対応する、
7aa4c006e4be *** empty log message ***
gongo
parents: 3
diff changeset
35 // SpeTask を継承する class を作ればいい。。。はず
7aa4c006e4be *** empty log message ***
gongo
parents: 3
diff changeset
36 return new SpeTask(list, &list->tasks[--list->length],
7aa4c006e4be *** empty log message ***
gongo
parents: 3
diff changeset
37 m->get_curReadBuf(),
7aa4c006e4be *** empty log message ***
gongo
parents: 3
diff changeset
38 m->get_curWriteBuf(),
7aa4c006e4be *** empty log message ***
gongo
parents: 3
diff changeset
39 connector);
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
40 }
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
41 }