Mercurial > hg > Game > Cerium
changeset 893:2faa1f62d925 draft
fix SimpleTask alignment
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 16 Jul 2010 00:13:04 +0900 |
parents | a5ccf763fc3f |
children | d9d229ede3ff |
files | TaskManager/ChangeLog TaskManager/kernel/ppe/SimpleTask.h TaskManager/kernel/schedule/SchedTaskArray.cc TaskManager/kernel/schedule/SchedTaskArrayLoad.cc TaskManager/kernel/schedule/SchedTaskArrayNop.cc TaskManager/kernel/schedule/Scheduler.cc |
diffstat | 6 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/ChangeLog Thu Jul 15 11:59:53 2010 +0900 +++ b/TaskManager/ChangeLog Fri Jul 16 00:13:04 2010 +0900 @@ -1,3 +1,8 @@ +2010-7-16 Shinji KONO <kono@ie.u-ryukyu.ac.jp> + + SimpleTask のsizeを16の倍数に。そうしないと、Taskのaligmentが16に + ならないので、gcc -O9 で破綻する。 + 2010-7-14 Shinji KONO <kono@ie.u-ryukyu.ac.jp> SchedTaskArray::exec の run の値が最適化で、おかしくなるのは、gcc のbugらしい。
--- a/TaskManager/kernel/ppe/SimpleTask.h Thu Jul 15 11:59:53 2010 +0900 +++ b/TaskManager/kernel/ppe/SimpleTask.h Fri Jul 16 00:13:04 2010 +0900 @@ -17,6 +17,8 @@ memaddr wbuf; int r_size; int w_size; + int dm1; // sizeof(SimpleTask)==32 + int dm2; public: // functions
--- a/TaskManager/kernel/schedule/SchedTaskArray.cc Thu Jul 15 11:59:53 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArray.cc Fri Jul 16 00:13:04 2010 +0900 @@ -19,6 +19,9 @@ outListData.size = 0; outListData.length = 0; outListData.element = 0; + + cur_index = -1; + task = 0; } /** @@ -45,6 +48,8 @@ atask = (TaskPtr)st; array = 0; savedTask->cur_index += (atask->size()+sizeof(SimpleTask))/sizeof(SimpleTask); + cur_index = -1; + task = 0; } @@ -109,11 +114,15 @@ // allocate write buffer outListData.length = atask->outData_count; outListData.size = atask->outData_total_size(); + // atask->outData_offset += cur_index + 1 ; // to avoid compiler bug outListData.element = atask->outData(0); outListData.bound = (int*)manager->allocate(outListData.length*sizeof(int)); bound(&outListData); writebuf = manager->allocate(outListData.size); + //if (outListData.element == inListData.element ) { + // printf("bad %x\n",outListData.element); + //} } scheduler->dma_wait(DMA_READ); task_list[atask->command].run(this, readbuf, writebuf);
--- a/TaskManager/kernel/schedule/SchedTaskArrayLoad.cc Thu Jul 15 11:59:53 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArrayLoad.cc Fri Jul 16 00:13:04 2010 +0900 @@ -9,6 +9,7 @@ scheduler = s; savedTask = savedTask_; task = savedTask->task; + cur_index = -2; } SchedTaskArrayLoad::~SchedTaskArrayLoad() {}
--- a/TaskManager/kernel/schedule/SchedTaskArrayNop.cc Thu Jul 15 11:59:53 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArrayNop.cc Fri Jul 16 00:13:04 2010 +0900 @@ -16,6 +16,7 @@ outListData.size = 0; outListData.length = 0; outListData.element = 0; + cur_index = -3; } @@ -65,9 +66,7 @@ // 最後のTask が exec されて、次の Task を実行してかまわない。 - SchedTaskBase *n = savedTask->next(scheduler, savedTask); - - return n; + return savedTask->next(scheduler, savedTask); }
--- a/TaskManager/kernel/schedule/Scheduler.cc Thu Jul 15 11:59:53 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Fri Jul 16 00:13:04 2010 +0900 @@ -71,10 +71,8 @@ // Pipeline Stage SchedTaskBase* task2 = new SchedNop(); SchedTaskBase* task3 = new SchedNop(); - // main loop do { - __debug("----------\n"); task3->write(); task2->exec(); task1->read(); @@ -82,7 +80,7 @@ task3 = task2; task2 = task1; - task1 = task1->next(this, 0); + task1 = task1->next(this, 0); } while (task1); delete task3;