00001 #include <spu_mfcio.h>
00002 #include <string.h>
00003
00004 #include <moc.h>
00005 #include <internal/imoc_macros.h>
00006 #include <internal/spu/imoc_dma_spu.h>
00007
00008 int MOC_Put_data(void* source, uint64_t target, int count,
00009 MOC_Datatype datatype)
00010 {
00011 int bytecount;
00012
00013 if (((datatype & 0xF0) >> 4) == 0)
00014 bytecount = count;
00015 else
00016 bytecount = count * (((datatype & 0xF0) >> 4) * 2);
00017
00018 if (target == 0 || source == 0 || bytecount == 0)
00019 return 0;
00020 if ((target % 16) != 0 || (((uint32_t) source) % 16) != 0)
00021 return MOC_ERR_BAD_ALIGNMENT;
00022 if ((bytecount % 16) != 0)
00023 return MOC_ERR_BAD_SIZE;
00024 IMOC_TEST_BYTECOUNT(bytecount)
00025
00026 return IMOC_put_data(source, target, bytecount);
00027 }
00028