Mercurial > hg > Members > kono > Cerium
view example/get_segment/ppe/Hello1.cc @ 836:cc06efc75ad9
example fix 50%
author | tkaito |
---|---|
date | Tue, 25 May 2010 19:13:28 +0900 |
parents | 60aa3f241b10 |
children |
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); smanager->printf("Hello1 sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); smanager->printf("[%d] Main Mem %0lx len %d\n", task_id, (unsigned long)next,(int)SIZE); return 0; }