Mercurial > hg > Members > kono > Cerium
changeset 442:95a856a2d552
hoge... size/count
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 25 Sep 2009 04:40:31 +0900 |
parents | 7bae2117f239 |
children | 50ef76a39944 |
files | TaskManager/Cell/spe/CellScheduler.cc TaskManager/Cell/spe/CellScheduler.h TaskManager/kernel/schedule/Scheduler.cc TaskManager/kernel/schedule/Scheduler.h example/get_segment/spe/Makefile example/get_segment/spe/spe-main.cc |
diffstat | 6 files changed, 18 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/spe/CellScheduler.cc Fri Sep 25 03:49:01 2009 +0900 +++ b/TaskManager/Cell/spe/CellScheduler.cc Fri Sep 25 04:40:31 2009 +0900 @@ -66,7 +66,7 @@ そのためには、全部で、get_tag()する必要があるはず。 */ - +/* #define TEX_LOAD1 0 #define TEX_LOAD2 1 @@ -77,6 +77,7 @@ int i = (count++ % 2); return TEX_LOAD1*i + TEX_LOAD2*(1-i); } + */ /* end */
--- a/TaskManager/Cell/spe/CellScheduler.h Fri Sep 25 03:49:01 2009 +0900 +++ b/TaskManager/Cell/spe/CellScheduler.h Fri Sep 25 04:40:31 2009 +0900 @@ -13,7 +13,7 @@ void *allocate(int size); void mainMem_alloc(int id, int size); void mainMem_wait(void); - uint32 get_tag(); + // uint32 get_tag(); private: int mainMemNum;
--- a/TaskManager/kernel/schedule/Scheduler.cc Fri Sep 25 03:49:01 2009 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Fri Sep 25 04:40:31 2009 +0900 @@ -329,10 +329,10 @@ * Task load API */ void -Scheduler::allocate_code_segment(int count, int size) +Scheduler::allocate_code_segment(int size, int count) { // 既に overlay 領域があるので、それを追加する必要がある... - code_segment_pool = createMemList(count, size); + code_segment_pool = createMemList(size, count); } static void @@ -354,7 +354,11 @@ static void wait_load(Scheduler *m, int task_id) { - fprintf(stderr,"wait load task id %d\n",task_id); + MemorySegment *s = task_list[task_id].segment; + if (s) + fprintf(stderr,"wait load task id %d 0x%x\n",task_id,(int)s->data); + else + fprintf(stderr,"wait load task id %d 000000\n",task_id); // wait for code segment load m->wait_segment(task_list[task_id].segment); // calcurate call address @@ -388,6 +392,7 @@ { task_list[cmd].creator = creator; task_list[cmd].location = start; + size &= 0xfffffffe; task_list[cmd].end = start+size; task_list[cmd].entry_offset = entry_offset; task_list[cmd].load = load_task; @@ -485,7 +490,9 @@ uint32 Scheduler::get_tag() { - return 0; + static int tag = 0; + tag = tag++ & 0x1f; + return tag; } /*!
--- a/TaskManager/kernel/schedule/Scheduler.h Fri Sep 25 03:49:01 2009 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.h Fri Sep 25 04:40:31 2009 +0900 @@ -153,7 +153,7 @@ MemorySegment * get_segment(memaddr addr, MemList *m); MemorySegment * get_segment(memaddr addr, MemList *m, int size); - void allocate_code_segment(int count, int size); + void allocate_code_segment(int size, int count); virtual uint32 get_tag(); void put_segment(MemorySegment *s);
--- a/example/get_segment/spe/Makefile Fri Sep 25 03:49:01 2009 +0900 +++ b/example/get_segment/spe/Makefile Fri Sep 25 04:40:31 2009 +0900 @@ -9,7 +9,7 @@ CC = spu-g++ INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I.. -CFLAGS = $(INCLUDE) -O0 -g -Wall -fno-exceptions -fno-rtti#-DDEBUG +CFLAGS = $(INCLUDE) -O2 -g -Wall -fno-exceptions -fno-rtti#-DDEBUG # CFLAGS = -DNO_OVERLAY=1 $(CFLAGS) LIBS = -L../${CERIUM}/TaskManager -lspemanager -Wl,--gc-sections
--- a/example/get_segment/spe/spe-main.cc Fri Sep 25 03:49:01 2009 +0900 +++ b/example/get_segment/spe/spe-main.cc Fri Sep 25 04:40:31 2009 +0900 @@ -1,6 +1,5 @@ #include "Func.h" #include "Scheduler.h" -#include "LoadEntry.h" #include "createTask_offset.h" @@ -18,7 +17,8 @@ { SchedRegisterDynamicTask(HELLO_TASK, Hello, 0); SchedRegisterDynamicTask(HELLO_TASK1, Hello1, 1); - scheduler->allocate_code_segment(4,1024); + createTask_Hello(scheduler); + scheduler->allocate_code_segment(1024,4); print_ovly_table(); }