00001 #include <spu_mfcio.h> 00002 #include <string.h> 00003 #include <stdlib.h> 00004 00005 #include <moc.h> 00006 #include <spu/moc_dma_spu.h> 00007 #include <internal/imoc.h> 00008 #include <internal/imoc_macros.h> 00009 #include <internal/spu/imoc_dma_spu.h> 00010 00011 int MOC_IPut_data(void* source, uint64_t target, int count, 00012 MOC_Datatype datatype, MOC_Request *request) 00013 { 00014 int bytecount; 00015 00016 if (((datatype & 0xF0) >> 4) == 0) 00017 bytecount = count; 00018 else 00019 bytecount = count * (((datatype & 0xF0) >> 4) * 2); 00020 00021 if (target == 0 || source == 0 || bytecount == 0) 00022 return 0; 00023 if ((target % 16) != 0 || (((uint32_t) source) % 16) != 0) 00024 return MOC_ERR_BAD_ALIGNMENT; 00025 if ((bytecount % 16) != 0) 00026 return MOC_ERR_BAD_SIZE; 00027 IMOC_TEST_BYTECOUNT(bytecount) 00028 00029 request->request_type = MOC_REQ_TYPE_DMA; 00030 00031 return IMOC_iput_data(source, target, bytecount, 00032 &request->request_data.dma_data); 00033 } 00034
1.5.6