Mercurial > hg > Members > kono > Cerium
comparison TaskManager/Cell/spe/CellDmaManager.cc @ 1007:18a548c337cb
add mail_queue
author | yutaka@localhost.localdomain |
---|---|
date | Thu, 28 Oct 2010 08:39:19 +0900 |
parents | 61f33945f85d |
children | c67379f9d411 |
comparison
equal
deleted
inserted
replaced
1006:443c01049702 | 1007:18a548c337cb |
---|---|
77 if (ABIBIT>32) { | 77 if (ABIBIT>32) { |
78 unsigned long data0 = (unsigned long)data; | 78 unsigned long data0 = (unsigned long)data; |
79 spu_write_out_mbox((uint32)(data0>>32)); | 79 spu_write_out_mbox((uint32)(data0>>32)); |
80 } | 80 } |
81 #endif | 81 #endif |
82 (this->*end_dmawait_profile)(&global_mail_time); | |
83 } | |
84 | |
85 // mail を queue にしたみた。mailの書き出しの待ちあるのかわからないけど | |
86 //TASK_LIST_MAIL は仕事が最後に溜まってしまうけど、MailQueueなら出来る時にmailを書き出す | |
87 //ので多少は効果あるといいな。 | |
88 void CellDmaManager::mail_write_queue(memaddr data) | |
89 { | |
90 (this->*start_dmawait_profile)(); | |
91 if (0 == spu_readchcnt(SPU_WrOutMbox)) { | |
92 if (mail_queue.empty()) { | |
93 spu_write_out_mbox((uint32)data); | |
94 } else { | |
95 MailQueuePtr mail = mail_queue.getFirst(); | |
96 spu_write_out_mbox((uint32)mail->data); | |
97 mail_queue.free_(mail); | |
98 mail = mail_queue.create(); | |
99 mail->data = data; | |
100 mail_queue.addLast(mail); | |
101 } | |
102 } else { | |
103 MailQueuePtr mail = mail_queue.create(); | |
104 mail->data = data; | |
105 mail_queue.addLast(mail); | |
106 } | |
107 (this->*end_dmawait_profile)(&global_mail_time); | |
108 } | |
109 | |
110 // tasklist おわりに、MailQueue 全部を書き出す | |
111 void CellDmaManager::mail_write_finish_list(memaddr data) | |
112 { | |
113 | |
114 (this->*start_dmawait_profile)(); | |
115 | |
116 while (!mail_queue.empty()) { | |
117 MailQueuePtr mail = mail_queue.getFirst(); | |
118 spu_write_out_mbox((uint32)mail->data); | |
119 mail_queue.free_(mail); | |
120 } | |
121 | |
122 spu_write_out_mbox((uint32)data); | |
123 | |
82 (this->*end_dmawait_profile)(&global_mail_time); | 124 (this->*end_dmawait_profile)(&global_mail_time); |
83 } | 125 } |
84 | 126 |
85 memaddr CellDmaManager::mail_read() | 127 memaddr CellDmaManager::mail_read() |
86 { | 128 { |