# HG changeset patch # User kono@localhost.localdomain # Date 1244473836 -32400 # Node ID c9f8cfcdc5c2326471695c210a29c20516df26bf # Parent 57530cb7f7d13b0abcd03d245d4150ba6e28158d fix ppu mail box waiting (mainMem allocate) diff -r 57530cb7f7d1 -r c9f8cfcdc5c2 TaskManager/Cell/CellTaskManagerImpl.cc --- a/TaskManager/Cell/CellTaskManagerImpl.cc Mon Jun 08 23:19:11 2009 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Tue Jun 09 00:10:36 2009 +0900 @@ -5,6 +5,7 @@ #include "CellBufferManager.h" #include "PpeScheduler.h" #include "types.h" +// #define _PPE_DEBUG #include "error.h" CellTaskManagerImpl::~CellTaskManagerImpl(void) diff -r 57530cb7f7d1 -r c9f8cfcdc5c2 TaskManager/Cell/SpeThreads.cc --- a/TaskManager/Cell/SpeThreads.cc Mon Jun 08 23:19:11 2009 +0900 +++ b/TaskManager/Cell/SpeThreads.cc Tue Jun 09 00:10:36 2009 +0900 @@ -119,13 +119,16 @@ int SpeThreads::get_mail(int speid, int count, unsigned int* ret) { - while(spe_out_mbox_status(spe_ctx[speid]) < count); return spe_out_mbox_read(spe_ctx[speid], ret, count); } int SpeThreads::check_mail(int speid, int count, unsigned int* ret) { +/* + * spe_out_mbox_status return only 1, waiting for multiple length + * does not work. + */ if (spe_out_mbox_status(spe_ctx[speid]) >= count) { return spe_out_mbox_read(spe_ctx[speid], ret, count); } else { diff -r 57530cb7f7d1 -r c9f8cfcdc5c2 TaskManager/kernel/schedule/Scheduler.cc --- a/TaskManager/kernel/schedule/Scheduler.cc Mon Jun 08 23:19:11 2009 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Tue Jun 09 00:10:36 2009 +0900 @@ -4,6 +4,11 @@ #include "SchedNop.h" #include "error.h" +/* + * Edit kernel/schedule/xx.cc, Cell/spe/xx.cc will be over writen by this. + * Do not edit Cell/spe/xx.cc unless there is no kernel/schedule/xx.cc files. + */ + Scheduler::TaskObject task_list[MAX_TASK_OBJECT]; Scheduler::~Scheduler(void) diff -r 57530cb7f7d1 -r c9f8cfcdc5c2 example/mainMem/spe/Hello.cc --- 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; }