Mercurial > hg > Members > kono > Cerium
changeset 187:ac52c139ad45
fix
author | gongo@localhost.localdomain |
---|---|
date | Thu, 08 Jan 2009 13:46:57 +0900 |
parents | f7ad032575ed |
children | 06f39635a9b0 |
files | TaskManager/Cell/spe/SchedNop2Ready.cc TaskManager/Cell/spe/SchedTask.cc TaskManager/Cell/spe/Scheduler.cc TaskManager/Test/test_render/spe/DrawSpanRenew.cpp TaskManager/kernel/schedule/SchedNop2Ready.cc TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/Scheduler.cc include/TaskManager/Scheduler.h |
diffstat | 8 files changed, 87 insertions(+), 54 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/spe/SchedNop2Ready.cc Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/Cell/spe/SchedNop2Ready.cc Thu Jan 08 13:46:57 2009 +0900 @@ -26,7 +26,7 @@ delete p; - nextSched = scheduler->get_nextRenewTaskList(NULL, 0); + nextSched = scheduler->get_nextRenewTaskList(); // RenewTask がある if (nextSched) {
--- a/TaskManager/Cell/spe/SchedTask.cc Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/Cell/spe/SchedTask.cc Thu Jan 08 13:46:57 2009 +0900 @@ -303,25 +303,20 @@ if (__cur_index < __list->length) { SchedTaskBase *nextSched; - nextSched = __scheduler->get_nextRenewTaskList(__list, __cur_index); + nextSched = __scheduler->get_nextRenewTaskList(); // RenewTask がある if (nextSched) { + __scheduler->set_backupTaskList(__list); + __scheduler->set_backupTaskListIndex(__cur_index); return nextSched; } else { - TaskPtr nextTask - = &__list->tasks[__cur_index++]; + TaskPtr nextTask = &__list->tasks[__cur_index++]; nextSched = createSchedTask(nextTask); ((SchedTask*)nextSched)->__init__(__list, nextTask, __cur_index, __scheduler->get_curReadBuf(), __scheduler->get_curWriteBuf(), __scheduler); - - /** - * この理由は SchedTask:~SchedTask() で - */ - __list = NULL; - return nextSched; } } else { @@ -362,14 +357,18 @@ __list = NULL; return nextSched; } else { - uint32 nextList = (uint32)__list->next; + SchedTaskBase *nextList; + + nextList = __scheduler->get_nextRenewTaskList(); - if (nextList == 0) { + if (nextList) { + return nextList; + } else { TaskListPtr nextList = __scheduler->get_backupTaskList(); - // 中断した TaskList + // 中断した TaskList がある if (nextList) { - __cur_index = __scheduler->bakIndex_taskList; + __cur_index = __scheduler->get_backupTaskListIndex(); nextTask = &nextList->tasks[__cur_index++]; nextSched = createSchedTask(nextTask); @@ -382,11 +381,6 @@ } else { return new SchedNop2Ready(__scheduler); } - } else { - __scheduler->renewTop_taskList - = __scheduler->renewTop_taskList->next; - return createSchedTaskList(nextList, __scheduler, - SCHED_TASKLIST_RENEW); } } }
--- a/TaskManager/Cell/spe/Scheduler.cc Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/Cell/spe/Scheduler.cc Thu Jan 08 13:46:57 2009 +0900 @@ -145,17 +145,14 @@ * @return next RenewTaskList */ SchedTaskList* -Scheduler::get_nextRenewTaskList(TaskListPtr curList, int curIndex) +Scheduler::get_nextRenewTaskList(void) { if (renewTop_taskList) { TaskListPtr list = renewTop_taskList; renewTop_taskList = renewTop_taskList->next; renewCur_taskList = NULL; - - bak_curTaskList = curList; - bakIndex_taskList = curIndex; - - //list->next = NULL; + + list->next = NULL; SchedTaskList *sched = createSchedTaskList((uint32)list, this, SCHED_TASKLIST_RENEW); return sched; @@ -164,6 +161,18 @@ } } +void +Scheduler::set_backupTaskList(TaskListPtr cur_taskList) +{ + bak_curTaskList = cur_taskList; +} + +void +Scheduler::set_backupTaskListIndex(int cur_index) +{ + bakIndex_taskList = cur_index; +} + /** * RenewTaskList 実行前に中断した TaskList を返す * NULL の場合、中断した TaskList は無い。 @@ -173,7 +182,19 @@ TaskListPtr Scheduler::get_backupTaskList(void) { - return bak_curTaskList; + TaskListPtr ret = bak_curTaskList; + + bak_curTaskList = NULL; + return ret; +} + +int +Scheduler::get_backupTaskListIndex(void) +{ + int ret = bakIndex_taskList; + + bakIndex_taskList = 0; + return ret; } void
--- a/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp Thu Jan 08 13:46:57 2009 +0900 @@ -159,7 +159,7 @@ span->tex_width, span->tex_addr); tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL; tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL; - + goto FINISH; if (!isAvailableTile(tex_addr)) { spack->info.start = t; set_rgb(tex_addr);
--- a/TaskManager/kernel/schedule/SchedNop2Ready.cc Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedNop2Ready.cc Thu Jan 08 13:46:57 2009 +0900 @@ -26,7 +26,7 @@ delete p; - nextSched = scheduler->get_nextRenewTaskList(NULL, 0); + nextSched = scheduler->get_nextRenewTaskList(); // RenewTask がある if (nextSched) {
--- a/TaskManager/kernel/schedule/SchedTask.cc Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Thu Jan 08 13:46:57 2009 +0900 @@ -303,25 +303,20 @@ if (__cur_index < __list->length) { SchedTaskBase *nextSched; - nextSched = __scheduler->get_nextRenewTaskList(__list, __cur_index); + nextSched = __scheduler->get_nextRenewTaskList(); // RenewTask がある if (nextSched) { + __scheduler->set_backupTaskList(__list); + __scheduler->set_backupTaskListIndex(__cur_index); return nextSched; } else { - TaskPtr nextTask - = &__list->tasks[__cur_index++]; + TaskPtr nextTask = &__list->tasks[__cur_index++]; nextSched = createSchedTask(nextTask); ((SchedTask*)nextSched)->__init__(__list, nextTask, __cur_index, __scheduler->get_curReadBuf(), __scheduler->get_curWriteBuf(), __scheduler); - - /** - * この理由は SchedTask:~SchedTask() で - */ - __list = NULL; - return nextSched; } } else { @@ -362,14 +357,18 @@ __list = NULL; return nextSched; } else { - uint32 nextList = (uint32)__list->next; + SchedTaskBase *nextList; + + nextList = __scheduler->get_nextRenewTaskList(); - if (nextList == 0) { + if (nextList) { + return nextList; + } else { TaskListPtr nextList = __scheduler->get_backupTaskList(); - // 中断した TaskList + // 中断した TaskList がある if (nextList) { - __cur_index = __scheduler->bakIndex_taskList; + __cur_index = __scheduler->get_backupTaskListIndex(); nextTask = &nextList->tasks[__cur_index++]; nextSched = createSchedTask(nextTask); @@ -382,11 +381,6 @@ } else { return new SchedNop2Ready(__scheduler); } - } else { - __scheduler->renewTop_taskList - = __scheduler->renewTop_taskList->next; - return createSchedTaskList(nextList, __scheduler, - SCHED_TASKLIST_RENEW); } } }
--- a/TaskManager/kernel/schedule/Scheduler.cc Tue Jan 06 16:18:37 2009 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Thu Jan 08 13:46:57 2009 +0900 @@ -145,17 +145,14 @@ * @return next RenewTaskList */ SchedTaskList* -Scheduler::get_nextRenewTaskList(TaskListPtr curList, int curIndex) +Scheduler::get_nextRenewTaskList(void) { if (renewTop_taskList) { TaskListPtr list = renewTop_taskList; renewTop_taskList = renewTop_taskList->next; renewCur_taskList = NULL; - - bak_curTaskList = curList; - bakIndex_taskList = curIndex; - - //list->next = NULL; + + list->next = NULL; SchedTaskList *sched = createSchedTaskList((uint32)list, this, SCHED_TASKLIST_RENEW); return sched; @@ -164,6 +161,18 @@ } } +void +Scheduler::set_backupTaskList(TaskListPtr cur_taskList) +{ + bak_curTaskList = cur_taskList; +} + +void +Scheduler::set_backupTaskListIndex(int cur_index) +{ + bakIndex_taskList = cur_index; +} + /** * RenewTaskList 実行前に中断した TaskList を返す * NULL の場合、中断した TaskList は無い。 @@ -173,7 +182,19 @@ TaskListPtr Scheduler::get_backupTaskList(void) { - return bak_curTaskList; + TaskListPtr ret = bak_curTaskList; + + bak_curTaskList = NULL; + return ret; +} + +int +Scheduler::get_backupTaskListIndex(void) +{ + int ret = bakIndex_taskList; + + bakIndex_taskList = 0; + return ret; } void
--- a/include/TaskManager/Scheduler.h Tue Jan 06 16:18:37 2009 +0900 +++ b/include/TaskManager/Scheduler.h Thu Jan 08 13:46:57 2009 +0900 @@ -129,8 +129,11 @@ ListDataPtr get_curWriteBuf(void); TaskListPtr get_renewListBuf(void); - SchedTaskList* get_nextRenewTaskList(TaskListPtr curList, int curIndex); + void set_backupTaskList(TaskListPtr cur_taskList); + void set_backupTaskListIndex(int cur_index); + SchedTaskList* get_nextRenewTaskList(void); TaskListPtr get_backupTaskList(void); + int get_backupTaskListIndex(void); // なんか名前が変だが。。。 /* TaskGroup */