Mercurial > hg > Game > Cerium
comparison example/get_segment/ppe/Hello.cc @ 625:94d82f2c842f draft
64bit mode worked on Mac OS X.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Nov 2009 10:59:55 +0900 |
parents | c73aff02db67 |
children | 74fd8d2a7b9d |
comparison
equal
deleted
inserted
replaced
624:55c95360f95b | 625:94d82f2c842f |
---|---|
8 #define SIZE (4096*sizeof(int)) | 8 #define SIZE (4096*sizeof(int)) |
9 | 9 |
10 static int | 10 static int |
11 run(SchedTask *smanager, void *rbuf, void *wbuf) | 11 run(SchedTask *smanager, void *rbuf, void *wbuf) |
12 { | 12 { |
13 int task_id = smanager->get_param(0); | 13 long task_id = (long)smanager->get_param(0); |
14 int *ptr = 0; | 14 int *ptr = 0; |
15 #if 1 | 15 #if 1 |
16 ptr = (int*)smanager->allocate(SIZE); | 16 ptr = (int*)smanager->allocate(SIZE); |
17 | 17 |
18 smanager->mainMem_alloc(0, SIZE); | 18 smanager->mainMem_alloc(0, SIZE); |
27 #if 1 | 27 #if 1 |
28 smanager->mainMem_wait(); | 28 smanager->mainMem_wait(); |
29 next = (void *)smanager->mainMem_get(0); | 29 next = (void *)smanager->mainMem_get(0); |
30 | 30 |
31 smanager->dma_wait(PP_STORE); | 31 smanager->dma_wait(PP_STORE); |
32 smanager->dma_store(ptr, (uint32)next, | 32 smanager->dma_store(ptr, (memaddr)next, |
33 SIZE, PP_STORE); | 33 SIZE, PP_STORE); |
34 #endif | 34 #endif |
35 | 35 |
36 | 36 |
37 smanager->fprintf(smanager->stderr_,"sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); | 37 smanager->fprintf(smanager->stderr_,"sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); |
38 smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0x len %d\n", task_id, (unsigned int)next,(int)SIZE); | 38 smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0lx len %d\n", task_id, (long)next,(int)SIZE); |
39 | 39 |
40 return 0; | 40 return 0; |
41 } | 41 } |