Mercurial > hg > Members > yutaka > manager
view spe/Dma.cc @ 8:ec2c1003f9b6 default tip
fix mandel
author | yutaka@localhost.localdomain |
---|---|
date | Mon, 12 Apr 2010 23:58:19 +0900 |
parents | 68a98d68d62a |
children |
line wrap: on
line source
#include <stdio.h> #include <malloc.h> #include <spu_intrinsics.h> #include <spu_mfcio.h> #include "Dma.h" void dma_get(void *buf, unsigned int addr, int size, int tag) { //printf("dma get sie %d\n",size); mfc_get(buf, addr, size, tag, 0, 0); } void dma_put(void *buf, unsigned int addr, int size, int tag) { mfc_put(buf, addr, size, tag, 0, 0); } int dma_wait(int tag) { int dma_wait_time; spu_writech(MFC_WrTagMask, 1 << tag); spu_write_decrementer(0xFFFFFFFF); dma_wait_time = spu_read_decrementer(); spu_mfcstat(MFC_TAG_UPDATE_ALL); dma_wait_time = dma_wait_time - spu_read_decrementer(); return dma_wait_time; } int dma_stat(int tag) { spu_writech(MFC_WrTagMask, 1 << tag); return spu_mfcstat(MFC_TAG_UPDATE_IMMEDIATE); }