changeset 626:ab866bc8a624

64bit mode compatibility on Cell
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 16 Nov 2009 11:37:26 +0900
parents 60aa3f241b10
children 1481480f922a
files Renderer/Engine/Makefile.def Renderer/Engine/spe/ChainInit.cc Renderer/Engine/spe/CreateSpan.cc Renderer/Engine/spe/DrawBack.cc Renderer/Engine/spe/DrawSpan.cc Renderer/Test/Makefile.def TaskManager/Cell/spe/CellDmaManager.cc TaskManager/Cell/spe/CellScheduler.cc TaskManager/Makefile.cell TaskManager/Makefile.def TaskManager/include/types.h TaskManager/kernel/ppe/SimpleTask.h TaskManager/kernel/schedule/Scheduler.h example/HelloWorld/Makefile.def example/HelloWorld/spe/Hello.cc example/MemList/spe/Hello.cc example/basic/spe/Twice.cc example/dependency_task/spe/Exec.cc example/dependency_task/spe/Print.cc example/get_segment/spe/Hello.cc example/get_segment/spe/Hello1.cc example/get_segment/spe/Makefile example/mainMem/spe/Hello.cc example/many_task/spe/QuickSort.cc example/post_function/spe/Hello.cc example/renew_task/spe/Renew1.cc example/renew_task/spe/Renew2.cc example/renew_task/spe/Renew3.cc example/renew_task/spe/RenewStart.cc example/share_task/spe/Exec.cc example/share_task/spe/Load.cc example/task_queue/spe/Hello.cc example/word_count/spe/Exec.cc example/word_count/spe/Print.cc example/word_count3/spe/Exec.cc example/word_count3/spe/Print.cc
diffstat 36 files changed, 114 insertions(+), 86 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def	Mon Nov 16 10:59:55 2009 +0900
+++ b/Renderer/Engine/Makefile.def	Mon Nov 16 11:37:26 2009 +0900
@@ -2,7 +2,7 @@
 
 CERIUM = ../..
 
-ABI = -m64
+ABI = # -m64
 CC      = g++
 CFLAGS  = -g -Wall $(ABI) # -O9 -DDEBUG
 
--- a/Renderer/Engine/spe/ChainInit.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/Renderer/Engine/spe/ChainInit.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -22,7 +22,7 @@
 run(SchedTask *s,void *rbuf, void *wbuf)
 {
     CHAIN_VARS* idata = (CHAIN_VARS*)s->get_input(rbuf, 0);
-    uint32 chain_len = s->get_param(0);
+    uint32 chain_len = (unsigned long)s->get_param(0);
 
     // property は spe 上で allocate している(global)
     CHAIN_VARS *property = (CHAIN_VARS*)s->global_alloc(DATA_ID, sizeof(CHAIN_VARS)*chain_len);
--- a/Renderer/Engine/spe/CreateSpan.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/Renderer/Engine/spe/CreateSpan.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -279,10 +279,10 @@
 		g->send_spack = tmp_spack;
 
 		smanager->dma_wait(SPAN_PACK_STORE);
-		smanager->dma_store(g->send_spack, (uint32)spackList[g->prev_index],
+		smanager->dma_store(g->send_spack, (memaddr)spackList[g->prev_index],
 				    sizeof(SpanPack), SPAN_PACK_STORE);
 		
-		smanager->dma_load(g->spack, (uint32)spackList[index],
+		smanager->dma_load(g->spack, (memaddr)spackList[index],
 				   sizeof(SpanPack), SPAN_PACK_LOAD);
 		g->prev_index = index;
 		smanager->dma_wait(SPAN_PACK_LOAD);
@@ -309,12 +309,12 @@
 		g->send_spack = tmp_spack;
 
 		smanager->dma_wait(SPAN_PACK_STORE);
-		smanager->dma_store(g->send_spack, (uint32)spackList[index],
+		smanager->dma_store(g->send_spack, (memaddr)spackList[index],
 				    sizeof(SpanPack), SPAN_PACK_STORE);
 
 		spackList[index] = next;
 		
-		smanager->dma_load(g->spack, (uint32)spackList[index],
+		smanager->dma_load(g->spack, (memaddr)spackList[index],
 				   sizeof(SpanPack), SPAN_PACK_LOAD);
 		smanager->dma_wait(SPAN_PACK_LOAD);
 		g->spack->init((index+1)*split_screen_h);
@@ -433,20 +433,20 @@
     SpanPackPtr *spackList = (SpanPackPtr*)smanager->get_input(1);
     g->spack = (SpanPackPtr)smanager->get_input(2);
     g->send_spack = (SpanPackPtr)smanager->allocate(sizeof(SpanPack));
-    g->prev_index = (int)smanager->get_param(0);
+    g->prev_index = (long)smanager->get_param(0);
 
     // spack と send_spack は swap しながら DMA を繰り返すので
     // 自分で allocate した send_spack を覚えてないといけない
     SpanPackPtr free_spack = g->send_spack;
 
-    int charge_y_top = smanager->get_param(1);
-    int charge_y_end = smanager->get_param(2);
+    int charge_y_top = (long)smanager->get_param(1);
+    int charge_y_end = (long)smanager->get_param(2);
 
     do {
 	__debug_spe("CreateSpan allocated 0x%x\n",(uint32)next_pp);
 
 	if (pp->next != NULL) {
-	    smanager->dma_load(next_pp, (uint32)pp->next,
+	    smanager->dma_load(next_pp, (memaddr)pp->next,
 			       sizeof(PolygonPack), POLYGON_PACK_LOAD);
 	} else {
 	    next_pp = NULL;
@@ -496,7 +496,7 @@
     } while (pp);
 
     smanager->dma_wait(SPAN_PACK_STORE);
-    smanager->dma_store(g->spack, (uint32)spackList[g->prev_index],
+    smanager->dma_store(g->spack, (memaddr)spackList[g->prev_index],
 			sizeof(SpanPack), SPAN_PACK_STORE);
     smanager->dma_wait(SPAN_PACK_STORE);
 	__debug_spe("CreateSpan spack_stored 0x%x\n",(uint32)spackList[g->prev_index]);
--- a/Renderer/Engine/spe/DrawBack.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/Renderer/Engine/spe/DrawBack.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -20,10 +20,10 @@
 run(SchedTask *smanager, void *rbuf, void *wbuf)
 {
     __debug_spe("DrawBack\n");
-    int rgb          = smanager->get_param(0);
-    int rangex_start = smanager->get_param(1);
-    int rangex_end   = smanager->get_param(2);
-    int rangey       = smanager->get_param(3);
+    int rgb          = (long)smanager->get_param(0);
+    int rangex_start = (long)smanager->get_param(1);
+    int rangex_end   = (long)smanager->get_param(2);
+    int rangey       = (long)smanager->get_param(3);
     int rangex       = rangex_end - rangex_start + 1;
     int *linebuf;
 
--- a/Renderer/Engine/spe/DrawSpan.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/Renderer/Engine/spe/DrawSpan.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -423,16 +423,16 @@
     Span nop_span;
     nop_span.length_x = 1;
 
-    // uint32 display   = smanager->get_param(0);
-    // int screen_width = smanager->get_param(1);
-    int rangex_start = smanager->get_param(2);
-    int rangex_end   = smanager->get_param(3);
+    // uint32 display   = (long)smanager->get_param(0);
+    // int screen_width = (long)smanager->get_param(1);
+    int rangex_start = (long)smanager->get_param(2);
+    int rangex_end   = (long)smanager->get_param(3);
 
     // このタスクが担当する x の範囲
     int rangex = rangex_end - rangex_start + 1;
 
     // y の範囲
-    int rangey = smanager->get_param(4);
+    int rangey = (long)smanager->get_param(4);
     g->tileList = (TileListPtr)smanager->global_get(GLOBAL_TILE_LIST);
 
     g->zRow = zRow_init(smanager, rangex, rangey);
--- a/Renderer/Test/Makefile.def	Mon Nov 16 10:59:55 2009 +0900
+++ b/Renderer/Test/Makefile.def	Mon Nov 16 11:37:26 2009 +0900
@@ -1,7 +1,7 @@
 
 CERIUM = ../..
 
-ABI = -m64
+ABI = # -m64
 CC      = g++
 CFLAGS  = -g -Wall $(ABI)  # -O -DDEBUG
 
--- a/TaskManager/Cell/spe/CellDmaManager.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -81,16 +81,19 @@
 CellDmaManager::mail_write(memaddr data)
 {
     spu_write_out_mbox((uint32)data);
-    if (sizeof(memaddr)>4)
-	spu_write_out_mbox(data>>4);
+    if (sizeof(memaddr)>4) {
+	unsigned long data0 = (unsigned long)data;
+	spu_write_out_mbox((uint32)(data0>>4));
+    }
 }
 
 memaddr
 CellDmaManager::mail_read()
 {
-    memaddr mail = spu_read_in_mbox();
-    if (sizeof(memaddr)>4)
+    memaddr mail = (memaddr)spu_read_in_mbox();
+    if (sizeof(memaddr)>4) {
 	mail += (spu_read_in_mbox()<<4);
+    }
     return mail;
 }
 
--- a/TaskManager/Cell/spe/CellScheduler.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/TaskManager/Cell/spe/CellScheduler.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -39,19 +39,19 @@
     mainMemList[id] = NULL;
 
     mainMemNum++;
-    mail_write(MY_SPE_COMMAND_MALLOC);
-    mail_write(id);
-    mail_write(size);
+    mail_write((memaddr)MY_SPE_COMMAND_MALLOC);
+    mail_write((memaddr)id);
+    mail_write((memaddr)size);
 }
 
 void
 CellScheduler::mainMem_wait()
 {
-    uint32 id;
-    uint32 addr;
+    unsigned long id;
+    memaddr addr;
 
     while (mainMemNum > 0) {
-	id = mail_read();
+	id = (unsigned long)mail_read();
 	addr = mail_read();
 
 	mainMemList[id] = (void*)addr;
--- a/TaskManager/Makefile.cell	Mon Nov 16 10:59:55 2009 +0900
+++ b/TaskManager/Makefile.cell	Mon Nov 16 11:37:26 2009 +0900
@@ -13,8 +13,7 @@
     $(CELL_SPE_DIR)/Scheduler.cc\
     $(CELL_SPE_DIR)/SchedNop.cc        \
     $(CELL_SPE_DIR)/MemList.cc        \
-    $(CELL_SPE_DIR)/MemHash.cc        \
-    $(CELL_SPE_DIR)/TaskGroup.cc
+    $(CELL_SPE_DIR)/MemHash.cc        
 CELL_SPE_SCHEDULE_OBJ = $(CELL_SPE_SCHEDULE_SRC:.cc=.o)
 
 CELL_SPE_SRCS =  \
--- a/TaskManager/Makefile.def	Mon Nov 16 10:59:55 2009 +0900
+++ b/TaskManager/Makefile.def	Mon Nov 16 11:37:26 2009 +0900
@@ -27,7 +27,7 @@
 IMPL_CELL_SRCS = $(IMPL_FIFO_SRCS) $(wildcard $(IMPL_CELL_DIR)/*.cc)
 IMPL_CELL_OBJS = $(IMPL_CELL_SRCS:.cc=.o)
 
-ABI = -m64
+ABI = 
 
 CC     = g++   
 CFLAGS = -Wall `sdl-config --cflags` -g $(ABI)  # -O9 
--- a/TaskManager/include/types.h	Mon Nov 16 10:59:55 2009 +0900
+++ b/TaskManager/include/types.h	Mon Nov 16 11:37:26 2009 +0900
@@ -7,19 +7,10 @@
 typedef uint32_t uint32;
 typedef uint64_t uint64;
 
-#if SPU   // ifdef SPU
-typedef uint64_t memaddr;
-#else
-#ifdef MODE64
-typedef uint64_t memaddr;
-#else
 //  In LP64, sizeof(unsigned long)==8
 // typedef unsigned long memaddr;
+// SPU's memaddr and PPU's memaddr must match.
 typedef char* memaddr;
-#endif
-#endif
-
-
 
 
 #define SPE_ALIGNMENT 16
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/kernel/ppe/SimpleTask.h	Mon Nov 16 11:37:26 2009 +0900
@@ -0,0 +1,35 @@
+#ifndef INCLUDED_SIPMLE_TASK
+#define INCLUDED_SIPMLE_TASK
+
+#include "base.h"
+#include "types.h"
+
+#define MAX_PARAMS 8
+
+class SimpleTask {
+public: // variables
+
+    BASE_NEW_DELETE(SimpleTask);
+    int command;         // 4 byte
+    memaddr self;         // 4 byte (or 8byte on 64bit mode)
+
+    int param_size;        // 4 byte
+    memaddr param[MAX_PARAMS]; // 4*MAX_PARAMS byte
+
+public: // functions
+    SimpleTask() {};
+
+    SimpleTask(int r, void *read, int w, void *write) {
+        param[0] = (memaddr)r; param[2] = (memaddr)w;
+        param[1] = (memaddr)read; param[3] = (memaddr)write;
+    };
+
+    void set_input(void *i,int size) { param[0] = (memaddr)i; param[1] = (memaddr) size; };
+    void set_output(void *o,int size) { param[2] = (memaddr)o; param[3] = (memaddr) size; };
+
+};
+
+typedef SimpleTask *SimpleTaskPtr;
+
+#endif
+
--- a/TaskManager/kernel/schedule/Scheduler.h	Mon Nov 16 10:59:55 2009 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.h	Mon Nov 16 11:37:26 2009 +0900
@@ -198,7 +198,7 @@
 
 #ifndef NO_OVERLAY
 #define SchedRegisterDynamicTask(cmd, str, segment)                    \
-    register_dynamic_task(cmd,  _EAR_+_ovly_table[segment].file_offset, \
+    register_dynamic_task(cmd,  (memaddr)(_EAR_+_ovly_table[segment].file_offset), \
 		     _ovly_table[segment].size, \
                     runTask_##str, \
 	runTask_##str##_offset);
--- a/example/HelloWorld/Makefile.def	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/HelloWorld/Makefile.def	Mon Nov 16 11:37:26 2009 +0900
@@ -7,7 +7,7 @@
 # ex  linux/ps3
 CERIUM = ../../../Cerium
 
-CC      = g++ -m64
+CC      = g++ # -m64
 CFLAGS  = -g -Wall -O9
 
 INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
--- a/example/HelloWorld/spe/Hello.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/HelloWorld/spe/Hello.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -8,9 +8,9 @@
 static int
 run(SchedTask *smanager, void *rbuf, void *wbuf)
 {
-    int task_id = smanager->get_param(0);
+    long task_id = (long)smanager->get_param(0);
 
-    smanager->printf("[%d] Hello, World!!\n", task_id);
+    smanager->printf("[%ld] Hello, World!!\n", task_id);
 
     return 0;
 }
--- a/example/MemList/spe/Hello.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/MemList/spe/Hello.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -8,7 +8,7 @@
 static int
 run(SchedTask *smanager, void *rbuf, void *wbuf)
 {
-    int task_id = smanager->get_param(0);
+    int task_id = (long)smanager->get_param(0);
 
     smanager->printf("[%d] Hello, World!!\n", task_id);
 
--- a/example/basic/spe/Twice.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/basic/spe/Twice.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -15,7 +15,7 @@
 
     i_data = (int*)s->get_input(rbuf, 0);
     o_data = (int*)s->get_output(wbuf, 0);
-    length = s->get_param(0);
+    length = (long)s->get_param(0);
     
     for (int i = 0; i < length; i++) {
 	o_data[i] = i_data[i] * 2;
--- a/example/dependency_task/spe/Exec.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/dependency_task/spe/Exec.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -10,8 +10,8 @@
 {
     int *idata = (int*)s->get_input(rbuf, 0);
     int *odata = (int*)s->get_output(wbuf, 0);
-    int length = s->get_param(0);
-    int calnum = s->get_param(1);
+    int length = (long)s->get_param(0);
+    int calnum = (long)s->get_param(1);
 
     for (int i = 0; i < length; i++) {
 	odata[i] = idata[i] + calnum;
--- a/example/dependency_task/spe/Print.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/dependency_task/spe/Print.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -10,7 +10,7 @@
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
     int *idata = (int*)s->get_input(rbuf, 0);
-    int length = s->get_param(0);
+    int length = (long)s->get_param(0);
 
     s->printf("[TASK_PRINT]\n");
     for (int i = 0; i < length; i++) {
--- a/example/get_segment/spe/Hello.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/get_segment/spe/Hello.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -22,7 +22,7 @@
 static int
 run(SchedTask *smanager, void *rbuf, void *wbuf)
 {
-    int task_id = smanager->get_param(0);
+    int task_id = (long)smanager->get_param(0);
 
     unsigned int pc;
     __asm__ __volatile__(
@@ -36,7 +36,7 @@
     smanager->fprintf(smanager->stderr_,fmt+offset, fmt, offset);
 
     smanager->fprintf(smanager->stderr_,"[%d] Hello, World!! Seg1 \n"+offset, task_id);
-    smanager->fprintf(smanager->stderr_,"pc=0x%0x 0x%0x\n"+offset,pc, (unsigned int)&runTask_Hello);
+    smanager->fprintf(smanager->stderr_,"pc=0x%0x 0x%0lx\n"+offset,pc, (unsigned long)&runTask_Hello);
 
     return 0;
 }
--- a/example/get_segment/spe/Hello1.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/get_segment/spe/Hello1.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -21,7 +21,7 @@
 static int
 run(SchedTask *smanager, void *rbuf, void *wbuf)
 {
-    int task_id = smanager->get_param(0);
+    long task_id = (long)smanager->get_param(0);
 
     unsigned int pc;
     __asm__ __volatile__(
@@ -36,7 +36,7 @@
 
 
     smanager->fprintf(smanager->stderr_,"[%d] Hello, World Seg 2!!\n"+offset, task_id);
-    smanager->fprintf(smanager->stderr_,"pc=0x%0x 0x%0x\n"+offset,pc, (unsigned int)&runTask_Hello1);
+    smanager->fprintf(smanager->stderr_,"pc=0x%0x 0x%0lx\n"+offset,pc, (unsigned long)&runTask_Hello1);
 
     return 0;
 }
--- a/example/get_segment/spe/Makefile	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/get_segment/spe/Makefile	Mon Nov 16 11:37:26 2009 +0900
@@ -11,7 +11,7 @@
 CC      = spu-g++
 INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I..
 CFLAGS1  = $(INCLUDE) -O$(OLEVEL) -g -Wall -fno-exceptions -fno-rtti #-DDEBUG
-# CFLAGS  = -DNO_OVERLAY=1 $(CFLAGS1)
+CFLAGS  = -DNO_OVERLAY=1 $(CFLAGS1)
 CFLAGS  = $(CFLAGS1)
  
 LIBS = -L../${CERIUM}/TaskManager -lspemanager  -Wl,--gc-sections 
--- a/example/mainMem/spe/Hello.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/mainMem/spe/Hello.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -11,7 +11,7 @@
 static int
 run(SchedTask *smanager, void *rbuf, void *wbuf)
 {
-    int task_id = smanager->get_param(0);
+    int task_id = (long)smanager->get_param(0);
     int *ptr = 0;
 #if 1
     ptr = (int*)smanager->allocate(SIZE);
@@ -30,7 +30,7 @@
     next = (void *)smanager->mainMem_get(0);
 
     smanager->dma_wait(PP_STORE);
-    smanager->dma_store(ptr, (uint32)next,
+    smanager->dma_store(ptr, (memaddr)next,
 		SIZE, PP_STORE);
 #endif
 
--- a/example/many_task/spe/QuickSort.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/many_task/spe/QuickSort.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -13,7 +13,7 @@
 static int
 run(SchedTask *smanager, void* rbuff, void* wbuff) {
     int begin = 0;
-    int end   = smanager->get_param(0);
+    int end   = (long)smanager->get_param(0);
     DataPtr r_data = (DataPtr)smanager->get_input(0);
     DataPtr w_data = (DataPtr)smanager->get_output(0);
     //SpeProfile *prof = new SpeProfile;
--- a/example/post_function/spe/Hello.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/post_function/spe/Hello.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -9,7 +9,7 @@
 static int
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
-    int id = s->get_param(0);
+    int id = (long)s->get_param(0);
 
     printf("Hello, World!! post_func output %d\n", id);
 
--- a/example/renew_task/spe/Renew1.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/renew_task/spe/Renew1.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -22,8 +22,8 @@
     s->printf("[SPE] ** running Renew1\n");
     
     s->printf("[SPE] Create Task : Renew2\n");
-    TaskPtr nextTask = s->create_task(RENEW2);
-    s->wait_task(nextTask);
+    HTaskPtr nextTask = s->create_task(RENEW2);
+    nextTask->spawn();
     
     s->printf("[SPE] ** finish  Renew1\n\n");
 
--- a/example/renew_task/spe/Renew2.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/renew_task/spe/Renew2.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -16,8 +16,8 @@
     s->printf("[SPE] ** running Renew2\n");
 
     s->printf("[SPE] Create Task : Renew3\n");
-    TaskPtr nextTask =  s->create_task(RENEW3);
-    s->wait_task(nextTask);
+    HTaskPtr nextTask =  s->create_task(RENEW3);
+    nextTask->spawn();
     
     s->printf("[SPE] ** finish  Renew2\n\n");
 
--- a/example/renew_task/spe/Renew3.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/renew_task/spe/Renew3.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -16,8 +16,8 @@
     s->printf("[SPE] ** running Renew3\n");
     
     s->printf("[SPE] Create Task : Renew4\n");
-    TaskPtr nextTask =  s->create_task(RENEW4);
-    s->wait_task(nextTask);
+    HTaskPtr nextTask =  s->create_task(RENEW4);
+    nextTask->spawn();
     
     s->printf("[SPE] ** finish  Renew3\n");
     s->printf("\n");
--- a/example/renew_task/spe/RenewStart.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/renew_task/spe/RenewStart.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -15,12 +15,12 @@
     // overlay で動くの?
     SpeProfile *profile = new (tmp) SpeProfile;
 
-    int id = s->get_param(0);
+    int id = (long)s->get_param(0);
     s->printf("[SPE] Create Task : Renew1 %d\n", id);
-    TaskPtr nextTask =  s->create_task(RENEW1);
+    HTaskPtr nextTask =  s->create_task(RENEW1);
 
-    int *test_num = s->get_param(1);
-    int *local_num = s->allocate(sizeof(int));
+    int *test_num = (int*)s->get_param(1);
+    int *local_num = (int*)s->allocate(sizeof(int));
     *local_num = 555;
 
     // この add_inData は、メインメモリのアドレスになる。
@@ -28,7 +28,7 @@
     // local なアドレスを渡したい時には、set_param を使う。
     nextTask->add_param(local_num);
 
-    s->wait_task(nextTask);
+    nextTask->spawn();
     
     s->printf("[SPE] ** finish  RenewStart\n\n");
 
--- a/example/share_task/spe/Exec.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/share_task/spe/Exec.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -9,9 +9,9 @@
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
     int *idata = (int*)s->global_get(DATA_ID);
-    int length = s->get_param(0);
-    int number = s->get_param(1);
-    int calnum = s->get_param(2);
+    int length = (long)s->get_param(0);
+    int number = (long)s->get_param(1);
+    int calnum = (long)s->get_param(2);
 
     s->printf("[TASK_EXEC %02d] ", number);
     for (int i = 0; i < length; i++) {
--- a/example/share_task/spe/Load.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/share_task/spe/Load.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -11,7 +11,7 @@
 {
     int *idata = (int*)s->get_input(rbuf, 0);
     int *odata;
-    int length = s->get_param(0);
+    int length = (long)s->get_param(0);
 
     // SPU LS 内に領域確保し、データをコピー
     odata = (int*)s->global_alloc(DATA_ID, sizeof(int)*length);
--- a/example/task_queue/spe/Hello.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/task_queue/spe/Hello.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -9,7 +9,7 @@
 static int
 run(SchedTask *smanager, void *rbuf, void *wbuf)
 {
-    int task_id = smanager->get_param(0);
+    int task_id = (long)smanager->get_param(0);
 
     smanager->printf("[%d] Hello, World!!\n", task_id);
 
--- a/example/word_count/spe/Exec.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/word_count/spe/Exec.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -11,8 +11,8 @@
 {
     char *i_data = (char*)s->get_input(rbuf, 0);
     unsigned long long *o_data = (unsigned long long*)s->get_output(wbuf, 0);
-    int length = s->get_param(0);
-    int word_flag = s->get_param(1);
+    int length = (long)s->get_param(0);
+    int word_flag = (long)s->get_param(1);
     int word_num = 0;
     int line_num = 0;
     int i;
--- a/example/word_count/spe/Print.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/word_count/spe/Print.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -10,8 +10,8 @@
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
     unsigned long long *idata = (unsigned long long*)s->get_input(rbuf, 0);
-    int task_num = s->get_param(0);
-    int status_num = s->get_param(1);
+    int task_num = (long)s->get_param(0);
+    int status_num = (long)s->get_param(1);
     unsigned long long word_data[task_num];
 
     for (int i = 0; i < status_num; i++) {
--- a/example/word_count3/spe/Exec.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/word_count3/spe/Exec.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -11,8 +11,8 @@
 {
     char *i_data = (char*)s->get_input(rbuf, 0);
     unsigned long long *o_data = (unsigned long long*)s->get_output(wbuf, 0);
-    int length = s->get_param(0);
-    int word_flag = s->get_param(1);
+    int length = (long)s->get_param(0);
+    int word_flag = (long)s->get_param(1);
     int word_num = 0;
     int line_num = 0;
     int i;
--- a/example/word_count3/spe/Print.cc	Mon Nov 16 10:59:55 2009 +0900
+++ b/example/word_count3/spe/Print.cc	Mon Nov 16 11:37:26 2009 +0900
@@ -10,8 +10,8 @@
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
     unsigned long long *idata = (unsigned long long*)s->get_input(rbuf, 0);
-    int task_num = s->get_param(0);
-    int status_num = s->get_param(1);
+    int task_num = (long)s->get_param(0);
+    int status_num = (long)s->get_param(1);
     unsigned long long word_data[task_num];
 
     for (int i = 0; i < status_num; i++) {