Mercurial > hg > Members > kono > Cerium
changeset 836:cc06efc75ad9
example fix 50%
author | tkaito |
---|---|
date | Tue, 25 May 2010 19:13:28 +0900 |
parents | 4c292ff3558d |
children | 4318c1f750d1 |
files | TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/schedule/Scheduler.h example/MemList/spe/spe-main.cc example/get_segment/ppe/Hello.cc example/get_segment/ppe/Hello1.cc example/get_segment/spe/Hello.cc example/get_segment/spe/Hello1.cc example/renew_task/spe/Renew1.h |
diffstat | 8 files changed, 33 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/HTask.cc Tue May 25 03:41:10 2010 +0900 +++ b/TaskManager/kernel/ppe/HTask.cc Tue May 25 19:13:28 2010 +0900 @@ -18,7 +18,7 @@ void HTask::spawn(void) { - mimpl->spawn_task(this); + mimpl->spawn_task(this); } /*!
--- a/TaskManager/kernel/schedule/Scheduler.h Tue May 25 03:41:10 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.h Tue May 25 19:13:28 2010 +0900 @@ -46,9 +46,11 @@ } class Scheduler { +private: + TaskManagerImpl* manager_tmp; + public: virtual ~Scheduler(); - BASE_NEW_DELETE(Scheduler); /* variables */ @@ -96,6 +98,7 @@ void* global_get(int id); void global_set(int id, void *addr); void global_free(int id); + //MemList* createMemList(int size, int count); MemList* createMemList(int size, int count); void free_(void *p) { free(p); } @@ -124,7 +127,9 @@ /* manager */ - void set_manager(TaskManagerImpl *m) { manager = m; }; + void set_manager(TaskManagerImpl *m) { + manager = m; + }; /* user */
--- a/example/MemList/spe/spe-main.cc Tue May 25 03:41:10 2010 +0900 +++ b/example/MemList/spe/spe-main.cc Tue May 25 19:13:28 2010 +0900 @@ -1,5 +1,5 @@ #include "Func.h" -#include "Scheduler.h" +#include "SchedTask.h" SchedExternTask(Hello); @@ -7,6 +7,7 @@ * この関数は SpeScheduler から呼ばれるので * 必ずこの関数名でお願いします。 */ + void task_init(Scheduler *s) {
--- a/example/get_segment/ppe/Hello.cc Tue May 25 03:41:10 2010 +0900 +++ b/example/get_segment/ppe/Hello.cc Tue May 25 19:13:28 2010 +0900 @@ -34,8 +34,10 @@ #endif - smanager->fprintf(smanager->stderr_,"sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); - smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0lx len %d\n", task_id, (long)next,(int)SIZE); + //smanager->fprintf(smanager->stderr_,"sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); + //smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0lx len %d\n", task_id, (long)next,(int)SIZE); + smanager->printf("sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); + smanager->printf("[%d] Main Mem %0lx len %d\n", task_id, (long)next,(int)SIZE); return 0; }
--- a/example/get_segment/ppe/Hello1.cc Tue May 25 03:41:10 2010 +0900 +++ b/example/get_segment/ppe/Hello1.cc Tue May 25 19:13:28 2010 +0900 @@ -33,8 +33,10 @@ #endif - smanager->fprintf(smanager->stderr_,"Hello1 sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); - smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0lx len %d\n", task_id, (unsigned long)next,(int)SIZE); + //smanager->fprintf(smanager->stderr_,"Hello1 sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); + //smanager->fprintf(smanager->stderr_,"[%d] Main Mem %0lx len %d\n", task_id, (unsigned long)next,(int)SIZE); + smanager->printf("Hello1 sizeof(int) = [%d] sizeof(void*)=[%d]\n", (int)sizeof(int),(int)sizeof(void*)); + smanager->printf("[%d] Main Mem %0lx len %d\n", task_id, (unsigned long)next,(int)SIZE); return 0; }
--- a/example/get_segment/spe/Hello.cc Tue May 25 03:41:10 2010 +0900 +++ b/example/get_segment/spe/Hello.cc Tue May 25 19:13:28 2010 +0900 @@ -33,10 +33,15 @@ char *fmt = "char [%0x] offset [%0x]\n"; int offset = rel_offset(); - smanager->fprintf(smanager->stderr_,fmt+offset, fmt, offset); + //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%0lx\n"+offset,pc, (unsigned long)&runTask_Hello); - smanager->fprintf(smanager->stderr_,"[%d] Hello, World!! Seg1 \n"+offset, task_id); - smanager->fprintf(smanager->stderr_,"pc=0x%0x 0x%0lx\n"+offset,pc, (unsigned long)&runTask_Hello); + smanager->printf(fmt+offset, fmt, offset); + + smanager->printf("[%d] Hello, World!! Seg1 \n"+offset, task_id); + smanager->printf("pc=0x%0x 0x%0lx\n"+offset,pc, (unsigned long)&runTask_Hello); return 0; }
--- a/example/get_segment/spe/Hello1.cc Tue May 25 03:41:10 2010 +0900 +++ b/example/get_segment/spe/Hello1.cc Tue May 25 19:13:28 2010 +0900 @@ -32,11 +32,13 @@ char *fmt = "char [%0x] offset [%0x]\n"; int offset = rel_offset(); - smanager->fprintf(smanager->stderr_,fmt+offset, fmt, offset); - + //smanager->fprintf(smanager->stderr_,fmt+offset, fmt, offset); + //smanager->fprintf(smanager->stderr_,"[%d] Hello, World Seg 2!!\n"+offset, task_id); + //smanager->fprintf(smanager->stderr_,"pc=0x%0x 0x%0lx\n"+offset,pc, (unsigned long)&runTask_Hello1); - smanager->fprintf(smanager->stderr_,"[%d] Hello, World Seg 2!!\n"+offset, task_id); - smanager->fprintf(smanager->stderr_,"pc=0x%0x 0x%0lx\n"+offset,pc, (unsigned long)&runTask_Hello1); + smanager->printf(fmt+offset, fmt, offset); + smanager->printf("[%d] Hello, World Seg 2!!\n"+offset, task_id); + smanager->printf("pc=0x%0x 0x%0lx\n"+offset,pc, (unsigned long)&runTask_Hello1); return 0; }