changeset 629:8843edf37c0e

Cell 64 bit tried, but not yet worked. Cell's list DMA is 32bit.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 18 Nov 2009 13:32:58 +0900
parents 306c9a7717c3
children 9df0112f7ccf
files TaskManager/Cell/CellTaskListInfo.cc TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/SpeThreads.cc TaskManager/Cell/SpeThreads.h TaskManager/Cell/spe/CellDmaManager.cc TaskManager/Cell/spe/CellDmaManager.h TaskManager/Cell/spe/CellScheduler.cc TaskManager/ChangeLog TaskManager/Fifo/MainScheduler.cc TaskManager/Makefile.cell TaskManager/include/types.h TaskManager/kernel/ppe/Random.cc TaskManager/kernel/ppe/Random.h TaskManager/kernel/ppe/Task.cc TaskManager/kernel/ppe/TaskList.cc TaskManager/kernel/ppe/TaskList.h TaskManager/kernel/ppe/TaskManager.h TaskManager/kernel/schedule/ListData.h TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTask.h TaskManager/kernel/schedule/Scheduler.cc TaskManager/kernel/schedule/Scheduler.h example/HelloWorld/Makefile.cell example/HelloWorld/spe/Makefile
diffstat 24 files changed, 101 insertions(+), 149 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskListInfo.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Cell/CellTaskListInfo.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -3,7 +3,7 @@
 #include "CellTaskListInfo.h"
 
 #define NEXT_ADDR(addr, size) \
-    (TaskListPtr)((int)(addr) + (size))
+    (TaskListPtr)((memaddr)(addr) + (size))
 
 int
 CellTaskListInfo::extend_pool(int num)
--- a/TaskManager/Cell/CellTaskManagerImpl.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Cell/CellTaskManagerImpl.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -123,18 +123,9 @@
 	}
 
 	task = &list->tasks[list->length++];
-#if 0
-	task->command  = htask->command;
-	task->inData   = htask->inData;
-	task->outData  = htask->outData;
-	task->self     = (unsigned int)htask;
-#else
-	memcpy(task, (Task*)htask, sizeof(Task));
-#endif
-
-	// activeTaskQueue->free_(queue);
+	TaskPtr stask = (TaskPtr) task;
+	*stask = *(TaskPtr) htask;
     }
-
 }
 
 void
@@ -178,12 +169,11 @@
     ppeManager->mail_check(mail_list, waitTaskQueue);
 
     do {
-	unsigned int data;
+	memaddr data;
 
 	// SPE Scheduler からの mail check
 	for (int id = 0; id < machineNum; id++) {	    
 	    while (speThreads->check_mail(id, 1, &data)) {				
-		
 		/**
 		 * MY_SPE_STATUS_READY: SPE が持ってた Task 全て終了
 		 * MY_SPE_NOP: 特に意味のないコマンド
@@ -194,36 +184,39 @@
 		 * 一目でよくわからない書き方なんで、直したいところですが。。。
 		 */
 		// 名前あとでちゃんと決めよう => MY_SPE_... とかじゃなくて
-		if (data == MY_SPE_STATUS_READY) {
+		if (data == (memaddr)MY_SPE_STATUS_READY) {
 		    //__debug_ppe("[SPE %d] finish\n", id);
 		    flag_sendTaskList[id] = 1;
-		} else if (data == MY_SPE_COMMAND_MALLOC) {
+		} else if (data == (memaddr)MY_SPE_COMMAND_MALLOC) {
 		    //__debug_ppe("[PPE] MALLOC COMMAND from [SPE %d]\n", id);
 
 		    /**
 		     * info[0] = alloc_id; (CellScheduler::mainMem_alloc 参照)
 		     * info[1] = alloc_addr;
 		     */
-		    unsigned int alloc_info[3];
-		    int alloc_size;
-		    int command;
+		    memaddr alloc_info[2];
+		    long alloc_size;
+		    long command;
 		    
 		    speThreads->get_mail(id, 2, alloc_info);
-		    command = alloc_info[0];
-		    alloc_size = alloc_info[1];
+		    command = (long)alloc_info[0];
+		    alloc_size = (long)alloc_info[1];
 
 		    
-		    alloc_info[1] = (unsigned int)allocate(alloc_size);
+		    alloc_info[1] = (memaddr)allocate(alloc_size);
 		    /*
 		     * allocate された領域は今の SPE buffer にリンクとして接続する
 		     * ここでは TaskList を allocate(new) して登録してやろうか
 		     */
 
-		    //__debug_ppe("[PPE] MALLOCED 0x%x from [SPE %d]\n", alloc_info[1],id);
+		    //__debug_ppe("[PPE] MALLOCED 0x%lx from [SPE %d]\n", alloc_info[1],id);
+		    // 今のところ何もしてない。どうも、この allocate を free 
+		    // するのは、SPE task が返した値を見て行うらしい。それは、
+		    // 忘れやすいのではないか?
 		    speThreads->add_output_tasklist(command, alloc_info[1], alloc_size);
 
 		    speThreads->send_mail(id, 2, alloc_info);
-		} else if (data > MY_SPE_NOP) {
+		} else if (data > (memaddr)MY_SPE_NOP) {
 		    //__debug_ppe("[PPE] recv from [SPE %d] : 0x%x\n", id, data);
 		    HTaskPtr task = (HTaskPtr)data;
 		    task->post_func(schedTaskManager, task->post_arg1, task->post_arg2);
@@ -275,8 +268,7 @@
 
     taskListImpl->clear_taskList(speTaskList_bg[id]);
 
-    //speThreads->send_mail(id, 1, (unsigned int *)&speTaskList[id]);
-    speThreads->send_mail(id, 1, (unsigned int *)&speTaskList[id]);
+    speThreads->send_mail(id, 1, (memaddr *)&speTaskList[id]);
     flag_sendTaskList[id] = 0;
 }
 
--- a/TaskManager/Cell/SpeThreads.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Cell/SpeThreads.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -6,7 +6,7 @@
 
 SpeThreads::~SpeThreads(void)
 {
-    unsigned int mail = MY_SPE_COMMAND_EXIT;
+    memaddr mail = (memaddr)MY_SPE_COMMAND_EXIT;
     int ret;
 
     for (int i = 0; i < spe_num; i++) {
@@ -112,20 +112,21 @@
  *         if ([ret] < 0) no data read
  */
 int
-SpeThreads::get_mail(int speid, int count, unsigned int* ret)
+SpeThreads::get_mail(int speid, int count, memaddr *ret)
 {   
-    return spe_out_mbox_read(spe_ctx[speid], ret, count);    
+    // only used in CellTaskManagerImpl (should be removed?) 
+    return spe_out_mbox_read(spe_ctx[speid], (unsigned int*)ret, count*(sizeof(memaddr)/sizeof(int)));    
 }
 
 int
-SpeThreads::check_mail(int speid, int count, unsigned int* ret)
+SpeThreads::check_mail(int speid, int count, memaddr *ret)
 {
 /* 
  *  spe_out_mbox_status return only 1, waiting for multiple length
  *  does not work.
  */
     if (spe_out_mbox_status(spe_ctx[speid]) >= 1) {    
-	return spe_out_mbox_read(spe_ctx[speid], ret, count);   
+	return spe_out_mbox_read(spe_ctx[speid], (unsigned int*)ret, count*(sizeof(memaddr)/sizeof(int)));   
     } else {
 	return 0;            
     }
@@ -146,14 +147,14 @@
  * @param [num] The number of messages
  */
 void
-SpeThreads::send_mail(int speid, int num, unsigned int *data)
+SpeThreads::send_mail(int speid, int num, memaddr *data)
 
 {
-    spe_in_mbox_write(spe_ctx[speid], data, num, SPE_MBOX_ALL_BLOCKING);
+    spe_in_mbox_write(spe_ctx[speid], (unsigned int *)data, num*(sizeof(memaddr)/sizeof(int)), SPE_MBOX_ALL_BLOCKING);
 }
 
 void
-SpeThreads::add_output_tasklist(int command, unsigned int buff, int alloc_size)
+SpeThreads::add_output_tasklist(int command, memaddr buff, int alloc_size)
 {
     /*
      * output TaskList が無ければ新しく作る
--- a/TaskManager/Cell/SpeThreads.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Cell/SpeThreads.h	Wed Nov 18 13:32:58 2009 +0900
@@ -19,12 +19,12 @@
 
     /* functions */
     void init(void);
-    int get_mail(int speid, int count, unsigned int* ret); // BLOCKING
-    int check_mail(int speid, int count, unsigned int* ret); // NONBLOCK
-    void send_mail(int speid, int num, unsigned int *data); // BLOCKING
+    int get_mail(int speid, int count, memaddr *ret); // BLOCKING
+    int check_mail(int speid, int count, memaddr *ret); // NONBLOCK
+    void send_mail(int speid, int num, memaddr *data); // BLOCKING
     static void *spe_thread_run(void *arg);
     static void *frontend_thread_run(void *arg);
-    void add_output_tasklist(int command, unsigned int buff, int alloc_size);
+    void add_output_tasklist(int command, memaddr buff, int alloc_size);
 
 private:
     /* variables */
--- a/TaskManager/Cell/spe/CellDmaManager.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -81,7 +81,7 @@
 CellDmaManager::mail_write(memaddr data)
 {
     spu_write_out_mbox((uint32)data);
-    if (sizeof(memaddr)>4) {
+    if (ABIBIT>32) {
 	unsigned long data0 = (unsigned long)data;
 	spu_write_out_mbox((uint32)(data0>>4));
     }
@@ -91,7 +91,7 @@
 CellDmaManager::mail_read()
 {
     memaddr mail = (memaddr)spu_read_in_mbox();
-    if (sizeof(memaddr)>4) {
+    if (ABIBIT>32) {
 	mail += (spu_read_in_mbox()<<4);
     }
     return mail;
--- a/TaskManager/Cell/spe/CellDmaManager.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.h	Wed Nov 18 13:32:58 2009 +0900
@@ -14,7 +14,7 @@
     BASE_NEW_DELETE(CellDmaManager);
 
     typedef struct dma_list {
-	memaddr addr;
+	uint32 addr;  // should be memaddr, but in Cell's specification...
 	uint32 size;
     } DmaList, *DmaListPtr;
 
--- a/TaskManager/Cell/spe/CellScheduler.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Cell/spe/CellScheduler.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -36,7 +36,7 @@
 void
 CellScheduler::mainMem_alloc(int id, int size)
 {
-    mainMemList[id] = NULL;
+    mainMemList[id] = (memaddr)NULL;
 
     mainMemNum++;
     mail_write((memaddr)MY_SPE_COMMAND_MALLOC);
@@ -54,7 +54,7 @@
 	id = (unsigned long)mail_read();
 	addr = mail_read();
 
-	mainMemList[id] = (void*)addr;
+	mainMemList[id] = (memaddr)addr;
 	mainMemNum--;
     }    
 }
@@ -74,9 +74,6 @@
 CellScheduler::get_tag()
 {
     static int count = 0;
-    // int i = (count++ % 2);
-    // return TEX_LOAD1*i + TEX_LOAD2*(1-i);
-    //     0,1,2,3
     return TEX_LOAD1+(count++ % 2);
 }
 
--- a/TaskManager/ChangeLog	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/ChangeLog	Wed Nov 18 13:32:58 2009 +0900
@@ -1,3 +1,8 @@
+2009-11-15 Shinji KONO <kono@ie.u-ryukyu.ac.jp>
+
+List DMAって、32bit address を使っているらしい。それは、ちょっと
+ひどいなぁ。
+
 2009-11-14 Shinji KONO <kono@ie.u-ryukyu.ac.jp>
 
    やっぱり、TaskList の存在が許せない。あったとしても不定長でしょう。
--- a/TaskManager/Fifo/MainScheduler.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Fifo/MainScheduler.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -41,8 +41,12 @@
 void*
 MainScheduler::allocate(int size)
 {
+#ifdef HAS_POSIX_MEMALIGN
+    void *ptr;
+    posix_memalign(&ptr,SPE_ALIGNMENT_FULL, size);
+#else
     void *ptr = malloc(size);
-    bzero(ptr, size);
+#endif
 
     return ptr;
 }
@@ -55,7 +59,7 @@
 void
 MainScheduler::mainMem_alloc(int id, int size)
 {
-    mainMemList[id] = allocate(size);
+    mainMemList[id] = (memaddr)allocate(size);
 }
 
 #if 0
--- a/TaskManager/Makefile.cell	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/Makefile.cell	Wed Nov 18 13:32:58 2009 +0900
@@ -1,5 +1,7 @@
 include ./Makefile.def
 
+ABIBIT= 32
+ABI= -m$(ABIBIT)
 TARGET    = libCellManager.a
 SPETARGET = libspemanager.a
 
@@ -23,7 +25,6 @@
     $(CELL_SPE_DIR)/main.cc
 
 CELL_SPE_TASK_SRCS =  \
-    $(CELL_SPE_DIR)/TaskList.cc \
     $(CELL_SPE_DIR)/TaskQueue.cc \
     $(CELL_SPE_DIR)/Task.cc           
 
@@ -31,11 +32,11 @@
 
 CELL_SPE_OBJS = $(CELL_SPE_SRCS:.cc=.o) $(CELL_SPE_SCHEDULE_OBJ) $(CELL_SPE_TASK_SRCS:.cc=.o)
 
-SPUCC = spu-g++
+SPUCC = spu-g++ -DABIBIT=$(ABIBIT)
 
-EXTRA_CFLAGS = -D__CERIUM_CELL__ -fno-strict-aliasing
+EXTRA_CFLAGS = -D__CERIUM_CELL__ -DHAS_POSIX_MEMALIGN -fno-strict-aliasing
 
-SPE_CFLAGS = -fno-exceptions -fno-rtti -Wall -O9
+SPE_CFLAGS = -D__CERIUM_CELL__ -fno-exceptions -fno-rtti -Wall -O9
 
 all: default
 
--- a/TaskManager/include/types.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/include/types.h	Wed Nov 18 13:32:58 2009 +0900
@@ -7,10 +7,19 @@
 typedef uint32_t uint32;
 typedef uint64_t uint64;
 
-//  In LP64, sizeof(unsigned long)==8
-// typedef unsigned long memaddr;
-// SPU's memaddr and PPU's memaddr must match.
+//  HOST main memory address 
+//       SPU's (void *) is always 32bit (actually 18bit (256kbyte))
+//       memaddr is different from (void *) in SPU.
+//
+#ifdef __SPU__
+#if ABIBIT>32
+typedef uint64_t memaddr;
+#else
+typedef uint32_t memaddr;
+#endif
+#else
 typedef char* memaddr;
+#endif
 
 
 #define SPE_ALIGNMENT 16
--- a/TaskManager/kernel/ppe/Random.cc	Tue Nov 17 01:35:12 2009 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/time.h>
-#include "Random.h"
-#define HAS_SRANDOMDEV 1
-
-/**
- * /dev/urandom, random から取得した値を seed として使う
- */
-Random::Random(void)
-{
-    reset();
-}
-
-/**
- * 引数で seed を指定する
- */
-Random::Random(unsigned int seed)
-{
-    srandom(seed);
-}
-
-void
-Random::reset(void)
-{
-#if HAS_SRANDOMDEV    
-    FILE *fp;
-    unsigned int seed;
-    struct timeval tv;
-
-    fp = fopen("/dev/urandom", "r");
-    if (!fp) fp = fopen("/dev/random", "r");
-
-    if (fp) {
-	int res = fread(&seed, sizeof(unsigned int), 1, fp);
-	if (res != sizeof(unsigned int)) {
-	    fclose(fp);
-	    fp = NULL;
-	}
-    }
-
-    if (!fp) {
-	gettimeofday(&tv, NULL);
-	seed = (tv.tv_sec ^ tv.tv_usec);
-    } else {
-	fclose(fp);
-    }
-
-    srandom(seed);
-#else
-    srandomdev();
-#endif
-}
-
-/*!
-  1 から 2^(32-1) のランダムな数値を返す。
- */
-
-int
-Random::getData(void)
-{
-    return random();
-}
--- a/TaskManager/kernel/ppe/Random.h	Tue Nov 17 01:35:12 2009 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#ifndef INCLUDED_RANDOM
-#define INCLUDED_RANDOM
-
-class Random {
-public:
-    Random(void);
-    Random(unsigned int seed);
-
-    void reset(void);
-    int getData(void);
-};
-
-typedef Random *RandomPtr;
-
-#endif
--- a/TaskManager/kernel/ppe/Task.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/ppe/Task.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -71,7 +71,11 @@
     list.size += size;
 
     ListElementPtr elm = &list.element[list.length++];
+#ifdef __CERIUM_CELL__
+    elm->addr = (uint32)(unsigned long)addr;
+#else
     elm->addr = addr;
+#endif
     elm->size = size;
 
     return 0;
--- a/TaskManager/kernel/ppe/TaskList.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/ppe/TaskList.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -1,5 +1,5 @@
 #include "TaskList.h"
-
+/*
 TaskListPtr
 TaskList::append(TaskListPtr list, TaskListPtr q)
 {
@@ -13,4 +13,4 @@
 	return list;
     }
 }
-
+ */
--- a/TaskManager/kernel/ppe/TaskList.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/ppe/TaskList.h	Wed Nov 18 13:32:58 2009 +0900
@@ -17,8 +17,9 @@
     Task tasks[TASK_MAX_SIZE]; // 512
     TaskList *output; // 4 byte
     int a[1]; // padding
-
+/*
     static TaskList* append(TaskList*, TaskList*);
+ */
 };
 
 typedef TaskList* TaskListPtr;
--- a/TaskManager/kernel/ppe/TaskManager.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/ppe/TaskManager.h	Wed Nov 18 13:32:58 2009 +0900
@@ -2,7 +2,6 @@
 #define INCLUDED_TASK_MANAGER
 
 #include "TaskManagerImpl.h"
-#include "Random.h"
 #include "MemList.h"
 #include "HTask.h"
 
--- a/TaskManager/kernel/schedule/ListData.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/schedule/ListData.h	Wed Nov 18 13:32:58 2009 +0900
@@ -11,7 +11,12 @@
     BASE_NEW_DELETE(ListElement);
 
     int size;
+#ifdef __CERIUM_CELL__
+    uint32 addr;  // Cell の仕様なんでどうしようもない...
+    //     PowerPC 64bit だと動かない可能性も高いんだが...
+#else
     memaddr addr;
+#endif
 };
 
 typedef ListElement* ListElementPtr;
--- a/TaskManager/kernel/schedule/SchedTask.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/schedule/SchedTask.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -172,7 +172,7 @@
 SchedTask::get_input(void *buff, int index)
 {
     if (buff != NULL) {
-        return (void*)((memaddr)buff + inListData->bound[index]);
+        return (void*)((char*)buff + inListData->bound[index]);
     } else {
         return NULL;
     }
@@ -184,7 +184,11 @@
 memaddr
 SchedTask::get_inputAddr(int index)
 {
+#ifdef __CERIUM_CELL__
+    return (memaddr)inListData->element[index].addr;
+#else
     return inListData->element[index].addr;
+#endif
 }
 
 /**
@@ -203,7 +207,7 @@
 SchedTask::get_output(void *buff, int index)
 {
     if (buff != NULL) {
-        return (void*)((memaddr)buff + outListData->bound[index]);
+        return (void*)((char *)buff + outListData->bound[index]);
     } else {
         return NULL;
     }
@@ -215,7 +219,11 @@
 memaddr
 SchedTask::get_outputAddr(int index)
 {
+#ifdef __CERIUM_CELL__
+    return (memaddr)outListData->element[index].addr;
+#else
     return outListData->element[index].addr;
+#endif
 }
 
 /**
@@ -269,7 +277,7 @@
     scheduler->mainMem_wait();
 }
 
-void*
+memaddr
 SchedTask::mainMem_get(int id) {
     return scheduler->mainMem_get(id);
 }
--- a/TaskManager/kernel/schedule/SchedTask.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/schedule/SchedTask.h	Wed Nov 18 13:32:58 2009 +0900
@@ -87,7 +87,7 @@
 
     void mainMem_alloc(int id, int size);
     void mainMem_wait();
-    void* mainMem_get(int id);
+    memaddr mainMem_get(int id);
 
     MemorySegment * get_segment(memaddr addr, MemList *m);
     uint32 get_tag();
--- a/TaskManager/kernel/schedule/Scheduler.cc	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.cc	Wed Nov 18 13:32:58 2009 +0900
@@ -39,7 +39,7 @@
     }
 
     for (int i = 0; i < MAX_MAINMEM_AREA; i++) {
-        mainMemList[i] = NULL;
+        mainMemList[i] = (memaddr)NULL;
     }
 
 
@@ -168,7 +168,7 @@
  * mainMem_alloc で確保したメインメモリの領域アドレスを返す。
  * これは Fifo, Cell で共通
  */
-void*
+memaddr
 Scheduler::mainMem_get(int id)
 {
     return mainMemList[id];
--- a/TaskManager/kernel/schedule/Scheduler.h	Tue Nov 17 01:35:12 2009 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.h	Wed Nov 18 13:32:58 2009 +0900
@@ -46,10 +46,11 @@
     int buffFlag_taskList;
 
     /* GlobalMemoryList */
+    /* global among Tasks in the same CPU */
     void* globalList[MAX_GLOBAL_AREA];
 
     /* MainMemory Allocate Command List */
-    void* mainMemList[MAX_MAINMEM_AREA];
+    memaddr mainMemList[MAX_MAINMEM_AREA];
 
     /* Code Area */
     MemList *code_segment_pool;
@@ -103,7 +104,7 @@
 
     virtual void mainMem_alloc(int id, int size) {};
     virtual void mainMem_wait() {};
-    void *mainMem_get(int id);
+    memaddr mainMem_get(int id);
 
     MemorySegment * get_segment(memaddr addr, MemList *m);
     MemorySegment * get_segment(memaddr addr, MemList *m, int size);
--- a/example/HelloWorld/Makefile.cell	Tue Nov 17 01:35:12 2009 +0900
+++ b/example/HelloWorld/Makefile.cell	Wed Nov 18 13:32:58 2009 +0900
@@ -1,5 +1,8 @@
 include ./Makefile.def
 
+ABIBIT=32
+CFLAGS += -m$(ABIBIT)  -D__CERIUM_CELL__
+
 SRCS_TMP = $(wildcard *.cc)
 SRCS_EXCLUDE =  # ե
 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
@@ -21,10 +24,10 @@
 all: $(TARGET) speobject
 
 $(TARGET): $(OBJS) $(TASK_OBJS)
-	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
+	$(CC) $(CFLAGS) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
 
 speobject:
-	cd spe; $(MAKE)
+	cd spe; $(MAKE) ABIBIT=$(ABIBIT)
 
 run:
 	./$(TARGET) -cpu 6 
--- a/example/HelloWorld/spe/Makefile	Tue Nov 17 01:35:12 2009 +0900
+++ b/example/HelloWorld/spe/Makefile	Wed Nov 18 13:32:58 2009 +0900
@@ -6,7 +6,7 @@
 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
 OBJS = $(SRCS:.cc=.o)
 
-CC      = spu-g++
+CC      = spu-g++  -D__CERIUM_CELL__ -DABIBIT=$(ABIBIT)
 CFLAGS  = -O9 -g -Wall -fno-exceptions -fno-rtti#-DDEBUG
 INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I..
 LIBS = -L../${CERIUM}/TaskManager -lspemanager  -Wl,--gc-sections 
@@ -23,4 +23,4 @@
 
 clean:
 	rm -f $(TARGET) $(OBJS)
-	rm -f *~ \#*
\ No newline at end of file
+	rm -f *~ \#*