Mercurial > hg > Game > Cerium
annotate TaskManager/Fifo/FifoDmaManager.h @ 1024:cf0ad93028e9 draft
add task list mail time profile.
author | yutaka@localhost.localdomain |
---|---|
date | Mon, 08 Nov 2010 14:02:23 +0900 |
parents | 00c01f416e3a |
children | 898fdcf53c31 |
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" | |
6 #include "MailManager.h" | |
3 | 7 |
8 class FifoDmaManager : public DmaManager { | |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
9 |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
10 protected: |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
11 /* variables */ |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
12 MailManagerPtr mail_queue1; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
13 MailManagerPtr mail_queue2; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
14 |
3 | 15 public: |
109 | 16 BASE_NEW_DELETE(FifoDmaManager); |
17 | |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
18 FifoDmaManager() { |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
19 mail_queue1 = new MailManager(); |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
20 mail_queue2 = new MailManager(); |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
21 } |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
22 |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
23 ~FifoDmaManager() { |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
24 delete mail_queue1; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
25 delete mail_queue2; |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
26 } |
3 | 27 |
28 /* functions */ | |
603
57ec231bc8ac
long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
602
diff
changeset
|
29 void dma_load(void *buf, memaddr addr, uint32 size, uint32 mask); |
57ec231bc8ac
long -> memaddr (64 or 32)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
602
diff
changeset
|
30 void dma_store(void *buf, memaddr addr, uint32 size, uint32 mask); |
88 | 31 void dma_wait(uint32 mask) ; |
3 | 32 |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
33 void mail_write(memaddr data) { mail_queue1->send(data); } |
1007 | 34 void mail_write_queue(memaddr data) { mail_queue1->send(data); } |
35 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
|
36 memaddr mail_read() { return mail_queue2->recv(); } |
1024
cf0ad93028e9
add task list mail time profile.
yutaka@localhost.localdomain
parents:
1007
diff
changeset
|
37 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
|
38 |
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
39 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
|
40 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
|
41 int has_mail_from_host() { return mail_queue1->count(); } |
109 | 42 |
43 void dma_loadList(ListDataPtr list, void *buff, uint32 mask); | |
44 void dma_storeList(ListDataPtr, void *buff, uint32 mask); | |
647
7ba4ad4538b1
MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
603
diff
changeset
|
45 |
3 | 46 }; |
47 | |
48 #endif |