diff example/mainMem/spe/Hello.cc @ 313:c9f8cfcdc5c2

fix ppu mail box waiting (mainMem allocate)
author kono@localhost.localdomain
date Tue, 09 Jun 2009 00:10:36 +0900
parents 57530cb7f7d1
children 2ddf79a7c5fb
line wrap: on
line diff
--- a/example/mainMem/spe/Hello.cc	Mon Jun 08 23:19:11 2009 +0900
+++ b/example/mainMem/spe/Hello.cc	Tue Jun 09 00:10:36 2009 +0900
@@ -12,24 +12,31 @@
 Hello::run(void *rbuf, void *wbuf)
 {
     int task_id = get_param(0);
-    int *ptr = smanager->allocate(SIZE);
+    int *ptr = 0;
+#if 1
+    ptr = (int*)smanager->allocate(SIZE);
 
-    smanager->mainMem_alloc(0, sizeof(PolygonPack));
+    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();
-    void *next = (void *)smanager->mainMem_get(0);
+    next = (void *)smanager->mainMem_get(0);
 
     smanager->dma_wait(PP_STORE);
     smanager->dma_store(ptr, (uint32)next,
 		SIZE, PP_STORE);
+#endif
 
 
-    printf("[%d] Main Mem %0x len %d\n", task_id, (int*)next,SIZE);
+    fprintf(stderr,"sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*));
+    fprintf(stderr,"[%d] Main Mem %0x len %d\n", task_id, (unsigned int)next,(int)SIZE);
 
     return 0;
 }