diff TaskManager/Cell/spe/CellDmaManager.cc @ 109:028ffc9c0375 draft

Cerium cvs version
author gongo@gendarme.local
date Wed, 12 Nov 2008 17:39:33 +0900
parents 504899860e66
children e3b7776b1420
line wrap: on
line diff
--- a/TaskManager/Cell/spe/CellDmaManager.cc	Wed Nov 12 17:29:35 2008 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.cc	Wed Nov 12 17:39:33 2008 +0900
@@ -6,19 +6,17 @@
 void
 CellDmaManager::dma_load(void *buf, uint32 addr, uint32 size, uint32 mask)
 {
-    //if (buf == NULL || (void*)addr == NULL) return;
     if (size == 0) return ;
-    spu_mfcdma32(buf, addr, ROUND_UP_ALIGN(size, DEFAULT_ALIGNMENT),
-		 mask, MFC_GET_CMD);
+    spu_mfcdma32(buf, addr, size, mask, MFC_GET_CMD);
 }
 
 void
 CellDmaManager::dma_store(void *buf, uint32 addr, uint32 size, uint32 mask)
 {
-    //if (buf == NULL || (void*)addr == NULL) return;
     if (size == 0) return ;
-    spu_mfcdma32(buf, addr, ROUND_UP_ALIGN(size, DEFAULT_ALIGNMENT),
-		 mask, MFC_PUT_CMD);
+    spu_mfcdma32(buf, addr, size, mask, MFC_PUT_CMD);
+
+    //spu_mfcdma32(buf, addr, ROUND_UP_ALIGN(size, DEFAULT_ALIGNMENT),
 }
 
 /**
@@ -40,18 +38,29 @@
 unsigned int
 CellDmaManager::mail_read(void)
 {
-    return spu_readch(SPU_RdInMbox);
+    unsigned int mail = spu_readch(SPU_RdInMbox);
+    return mail;
+}
+
+void
+CellDmaManager::dma_loadList(ListDataPtr list, void *buff, uint32 mask)
+{
+    mfc_getl(buff, 0, list->element, sizeof(mfc_list_element_t)*list->length,
+	     mask, 0, 0);
 }
 
 void
-CellDmaManager::dmaList_set(uint32 _address, uint32 _size)
+CellDmaManager::dma_storeList(ListDataPtr list, void *buff, uint32 mask)
 {
-    int *index = &buff_index[buff_flag];
-    DmaListPtr queue = &dmaQueue[buff_flag][(*index)++];
+    mfc_putl(buff, 0, list->element, sizeof(mfc_list_element_t)*list->length,
+	     mask, 0, 0);
+}
+
 
-    queue->addr = _address;
-    queue->size = ROUND_UP_ALIGN(_size, DEFAULT_ALIGNMENT);
-}
+#if 0
+/**
+ * dma_loadList の前ばーじょn
+ */
 
 void**
 CellDmaManager::dmaList_load(uint32 mask)
@@ -104,3 +113,4 @@
 
     return buffList;
 }
+#endif