Mercurial > hg > Game > Cerium
changeset 872:d7b0c0f8514c draft
add overlay segment
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 04 Jul 2010 17:59:53 +0900 |
parents | d30617ef4b20 |
children | c50f39fbb6ca |
files | TaskManager/kernel/schedule/Scheduler.cc TaskManager/kernel/schedule/Scheduler.h example/get_segment/spe/Hello.cc example/get_segment/spe/spe-main.cc |
diffstat | 4 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/Scheduler.cc Sun Jul 04 16:56:04 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Sun Jul 04 17:59:53 2010 +0900 @@ -200,10 +200,18 @@ * Task load API */ void -Scheduler::allocate_code_segment(int size, int count) +Scheduler::allocate_code_segment(int size, int count, struct tbl *table) { // 既に overlay 領域があるので、それを追加する必要がある... code_segment_pool = createMemList(size, count); + if (table) { + MemorySegment* here = (MemorySegment*)( + manager->allocate(sizeof(MemorySegment))); + here->data = (void*)(table->vma); + here->size = size; + here->address = (memaddr)here; + code_segment_pool->addLast(here); + } } static void @@ -220,7 +228,7 @@ (char*)task_list[task_id].segment->data + task_list[task_id].entry_offset); task_list[task_id].run = run; -#if 0 +#if 1 m->printf("loadng task id %d at 0x%x entry 0x%x\n",task_id, (unsigned int)(task_list[task_id].segment->data ), (unsigned int)(
--- a/TaskManager/kernel/schedule/Scheduler.h Sun Jul 04 16:56:04 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.h Sun Jul 04 17:59:53 2010 +0900 @@ -108,7 +108,7 @@ MemorySegment * get_segment(memaddr addr, MemList *m); MemorySegment * get_segment(memaddr addr, MemList *m, int size); - void allocate_code_segment(int size, int count); + void allocate_code_segment(int size, int count,struct tbl *table); virtual uint32 get_tag(); void put_segment(MemorySegment *s);
--- a/example/get_segment/spe/Hello.cc Sun Jul 04 16:56:04 2010 +0900 +++ b/example/get_segment/spe/Hello.cc Sun Jul 04 17:59:53 2010 +0900 @@ -40,8 +40,9 @@ smanager->printf(fmt+offset, fmt, offset); - smanager->printf("[%d] Hello, World!! Seg1 \n"+offset, task_id); + 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/spe-main.cc Sun Jul 04 16:56:04 2010 +0900 +++ b/example/get_segment/spe/spe-main.cc Sun Jul 04 17:59:53 2010 +0900 @@ -18,7 +18,7 @@ SchedRegisterDynamicTask(HELLO_TASK, Hello, 0); SchedRegisterDynamicTask(HELLO_TASK1, Hello1, 1); // createTask_Hello(scheduler); - scheduler->allocate_code_segment(1024,4); + scheduler->allocate_code_segment(1024,4, _ovly_table); print_ovly_table(); }