Mercurial > hg > Members > kono > Cerium
view example/get_segment/ppe/Hello1.cc @ 639:70c5c2d2eb24
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | 60aa3f241b10 |
children | cc06efc75ad9 |
line wrap: on
line source
#include "Hello1.h" #include "Func.h" /* これは必須 */ SchedDefineTask(Hello1); #define PP_STORE 3 #define SIZE (4096*sizeof(int)) static int run(SchedTask *smanager, void *rbuf, void *wbuf) { long task_id = (long)smanager->get_param(0); int *ptr = 0; #if 1 ptr = (int*)smanager->allocate(SIZE); smanager->mainMem_alloc(0, SIZE); int i; for(i=0;i<4096;i++) { ptr[i] = i; } #endif void *next = 0; #if 1 smanager->mainMem_wait(); next = (void *)smanager->mainMem_get(0); smanager->dma_wait(PP_STORE); smanager->dma_store(ptr, (memaddr)next, SIZE, PP_STORE); #endif smanager->fprintf(smanager->stderr_,"Hello1 sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0lx len %d\n", task_id, (unsigned long)next,(int)SIZE); return 0; }