Mercurial > hg > Game > Cerium
annotate TaskManager/Fifo/FifoDmaManager.h @ 1213:a49c02dffe6f draft
DMA connector reogranization
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 22 Jul 2011 13:25:30 +0900 |
parents | 27e35b4098a4 |
children | bb75ee244826 |
rev | line source |
---|---|
3 | 1 #ifndef INCLUDED_FIFO_DMA_MANAGER |
2 #define INCLUDED_FIFO_DMA_MANAGER | |
3 | |
307 | 4 #include "base.h" |
5 #include "DmaManager.h" | |
1190
cfbf4f264829
fix FifoDmaManager.h
Daichi TOMA <amothic@cr.ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
6 #ifdef __CERIUM_PARALLEL__ |
1196
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1190
diff
changeset
|
7 #include "SynchronizedMailManager.h" |
1190
cfbf4f264829
fix FifoDmaManager.h
Daichi TOMA <amothic@cr.ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
8 #else |
307 | 9 #include "MailManager.h" |
1190
cfbf4f264829
fix FifoDmaManager.h
Daichi TOMA <amothic@cr.ie.u-ryukyu.ac.jp>
parents:
1189
diff
changeset
|
10 #endif |
3 | 11 |
12 class FifoDmaManager : public DmaManager { | |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
13 |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
14 protected: |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
15 /* variables */ |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
16 MailManagerPtr mail_queue1; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
17 MailManagerPtr mail_queue2; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
18 |
3 | 19 public: |
109 | 20 BASE_NEW_DELETE(FifoDmaManager); |
21 | |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
22 FifoDmaManager() { |
1189 | 23 #ifdef __CERIUM_PARALLEL__ |
1196
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1190
diff
changeset
|
24 mail_queue1 = new SynchronizedMailManager(); |
27e35b4098a4
Rename MailManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents:
1190
diff
changeset
|
25 mail_queue2 = new SynchronizedMailManager(); |
1189 | 26 #else |
27 mail_queue1 = new MailManager(); | |
28 mail_queue2 = new MailManager(); | |
29 #endif | |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
30 } |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
31 |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
32 ~FifoDmaManager() { |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
33 delete mail_queue1; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
34 delete mail_queue2; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
35 } |
3 | 36 |
37 /* functions */ | |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
38 void *dma_load(Scheduler *s, void *buf, memaddr addr, uint32 size, uint32 mask); |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
39 void *dma_store(void *buf, memaddr addr, uint32 size, uint32 mask); |
88 | 40 void dma_wait(uint32 mask) ; |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
41 void *get_writebuf(Scheduler *s, memaddr addr, uint32 size) ; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
42 |
3 | 43 |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
44 void mail_write(memaddr data) { mail_queue1->send(data); } |
1007 | 45 void mail_write_queue(memaddr data) { mail_queue1->send(data); } |
46 void mail_write_finish_list(memaddr data) { mail_queue1->send(data); } | |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
47 memaddr mail_read() { return mail_queue2->recv(); } |
1024
cf0ad93028e9
add task list mail time profile.
yutaka@localhost.localdomain
parents:
1007
diff
changeset
|
48 memaddr task_list_mail_read() { return mail_queue2->recv(); } |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
49 |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
50 void mail_write_from_host(memaddr data) { mail_queue2->send(data); } |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
51 memaddr mail_read_from_host() { return mail_queue1->recv(); } |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
52 int has_mail_from_host() { return mail_queue1->count(); } |
109 | 53 |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
54 void *dma_loadList(Scheduler *s, ListDataPtr list, void *buff, uint32 mask); |
109 | 55 void dma_storeList(ListDataPtr, void *buff, uint32 mask); |
1213
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
56 void *get_writebuf(Scheduler *s, ListDataPtr, uint32 size) ; |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
57 |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
58 uint32 get_tag(); |
a49c02dffe6f
DMA connector reogranization
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1196
diff
changeset
|
59 void bound(ListData *); |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
60 |
3 | 61 }; |
62 | |
63 #endif |