00001 #include <string.h> 00002 #include <stdlib.h> 00003 00004 #include <moc.h> 00005 #include <ppu/moc_dma_ppu.h> 00006 #include <internal/imoc.h> 00007 #include <internal/imoc_macros.h> 00008 #include <internal/ppu/imoc_dma_ppu.h> 00009 #include <internal/ppu/imoc_core_ppu.h> 00010 00011 int MOC_IPut_data(void* source, uint32_t target, int count, 00012 MOC_Datatype datatype, int src, 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 || (((uint64_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 IMOC_TEST_RANK(src) 00029 00030 request->request_type = MOC_REQ_TYPE_DMA; 00031 00032 return IMOC_iput_data(source, target, bytecount, src, 00033 &request->request_data.dma_data); 00034 } 00035
1.5.6