Mercurial > hg > Game > Cerium
changeset 64:eb2cb212881c
*** empty log message ***
author | gongo |
---|---|
date | Sun, 17 Feb 2008 11:19:25 +0900 |
parents | 54355e641172 |
children | 519d24aa7ac8 |
files | TaskManager/Fifo/FifoDmaManager.cc TaskManager/kernel/schedule/FifoDmaManager.cc |
diffstat | 2 files changed, 57 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoDmaManager.cc Sun Feb 17 10:55:22 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include "FifoDmaManager.h" - -void -FifoDmaManager::dma_load(void *buf, unsigned int addr, int size, int mask) -{ - if (buf == NULL || (void*)addr == NULL) return; - memcpy(buf, (void*)addr, size); -} - -void -FifoDmaManager::dma_store(void *buf, unsigned int addr, int size, int mask) -{ - if (buf == NULL || (void*)addr == NULL) return; - memcpy((void*)addr, buf, size); -} - -/** - * mask で設定した DMA 転送の完了を待つ - */ -void -FifoDmaManager::dma_wait(int mask) -{ - //spu_writech(MFC_WrTagMask, 1 << mask); - //spu_mfcstat(MFC_TAG_UPDATE_ALL); -} - -void -FifoDmaManager::mail_write(unsigned int data) -{ - //spu_writech(SPU_WrOutMbox, data); - - mail_sendQueue - = MailManager::append_mailQueue(mail_sendQueue, - mailManager->create(data)); -} - -unsigned int -FifoDmaManager::mail_read(void) -{ - MailQueuePtr q; - unsigned int ret; - - q = mail_recvQueue; - - if (q == NULL) { - return 0; // error か 正しい値か判断できないな・・・ - } - - mail_recvQueue = mail_recvQueue->next; - - ret = q->data; - mailManager->free(q); - - return ret; -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/kernel/schedule/FifoDmaManager.cc Sun Feb 17 11:19:25 2008 +0900 @@ -0,0 +1,57 @@ +#include <stdio.h> +#include <string.h> +#include "FifoDmaManager.h" + +void +FifoDmaManager::dma_load(void *buf, unsigned int addr, int size, int mask) +{ + if (buf == NULL || (void*)addr == NULL) return; + memcpy(buf, (void*)addr, size); +} + +void +FifoDmaManager::dma_store(void *buf, unsigned int addr, int size, int mask) +{ + if (buf == NULL || (void*)addr == NULL) return; + memcpy((void*)addr, buf, size); +} + +/** + * mask で設定した DMA 転送の完了を待つ + */ +void +FifoDmaManager::dma_wait(int mask) +{ + //spu_writech(MFC_WrTagMask, 1 << mask); + //spu_mfcstat(MFC_TAG_UPDATE_ALL); +} + +void +FifoDmaManager::mail_write(unsigned int data) +{ + //spu_writech(SPU_WrOutMbox, data); + + mail_sendQueue + = MailManager::append_mailQueue(mail_sendQueue, + mailManager->create(data)); +} + +unsigned int +FifoDmaManager::mail_read(void) +{ + MailQueuePtr q; + unsigned int ret; + + q = mail_recvQueue; + + if (q == NULL) { + return 0; // error か 正しい値か判断できないな・・・ + } + + mail_recvQueue = mail_recvQueue->next; + + ret = q->data; + mailManager->free(q); + + return ret; +}