Mercurial > hg > Game > Cerium
changeset 1756:165e11832816 draft
no compile error
author | kkb |
---|---|
date | Fri, 22 Nov 2013 13:08:00 +0900 |
parents | 27f5b13ff58c |
children | feba52cd8374 |
files | TaskManager/kernel/ppe/TaskList.cc TaskManager/kernel/ppe/TaskList.h TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTaskBase.h TaskManager/test/UtilizationTest/multiply |
diffstat | 5 files changed, 37 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/kernel/ppe/TaskList.cc Fri Nov 22 13:08:00 2013 +0900 @@ -0,0 +1,29 @@ +#include "TaskList.h" +#include "HTask.h" +#include "Scheduler.h" + +class HTask; + +int TaskList::ismultidim() { + TaskList* p = this; + int dim_count = 0; + int dim_count_max = 0; + while(p) { + if (p->dim>0) { + dim_count = (p->x)*(p->y)*(p->z); + if (dim_count_max < dim_count) dim_count_max = dim_count; + p->self->flag.dim_count = dim_count; + } + p = p->next; + } + return dim_count_max; +} + +void TaskList::print() { + printf("dim %d,x %d,y %d,z %d,cpu %d\n",dim,(int)x,(int)y,(int)z,cpu); + Task* t = &tasks[0]; + while(t) { + printf("command %s\n",task_list[t->command].name); + t = t->next(); + } +}
--- a/TaskManager/kernel/ppe/TaskList.h Fri Nov 22 12:39:07 2013 +0900 +++ b/TaskManager/kernel/ppe/TaskList.h Fri Nov 22 13:08:00 2013 +0900 @@ -29,29 +29,8 @@ void init() { lastTask = ((memaddr)&tasks[TASK_MAX_SIZE])-(memaddr)(tasks); waiter=this; dim=0;} void initOnce() { } void freeOnce() {} - int ismultidim() { - TaskList* p = this; - int dim_count = 0; - int dim_count_max = 0; - while(p) { - - if (p->dim>0) { - dim_count = (p->x)*(p->y)*(p->z); - if (dim_count_max < dim_count) dim_count_max = dim_count; - p->self->flag.dim_count = dim_count; - } - - p = p->next; - } - return dim_count_max; - } - void print() { - printf(""); - while(t) { - printf(t); - t = t->next(); - } - } + int ismultidim(); + void print(); } ;
--- a/TaskManager/kernel/schedule/SchedTask.cc Fri Nov 22 12:39:07 2013 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Fri Nov 22 13:08:00 2013 +0900 @@ -186,10 +186,10 @@ if (cur_index == 0) { // 最初の一つ while (!list->dim && list->cpu != scheduler->id) - list=(memaddr)list->next; + list=list->next; if (list == 0) return new SchedNop2Ready(scheduler); SchedTask *nextSched = new SchedTask(); - nextSched->init(list, &list->tasks[cur_index], scheduler, this->tag^1); + nextSched->init(list, &list->tasks[0], scheduler, this->tag^1); return nextSched; } TaskPtr nextTask = cur_index->next(); // ここで一個一個のtaskを取ってきてる @@ -202,9 +202,9 @@ nextSched->init(list, nextTask, scheduler, this->tag^1); return nextSched; } else { - list = (memaddr)list->next; + list = list->next; while (!list->dim && list->cpu != scheduler->id) - list=(memaddr)list->next; + list=list->next; memaddr nextList = (memaddr)list; if (nextList == 0) { // もう何もする必要がない
--- a/TaskManager/kernel/schedule/SchedTaskBase.h Fri Nov 22 12:39:07 2013 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskBase.h Fri Nov 22 13:08:00 2013 +0900 @@ -10,6 +10,7 @@ class MemorySegment; class MemList; class HTask; +class TaskList; class SchedTaskBase { public: @@ -91,7 +92,7 @@ TaskPtr atask; // 現在スケジューラが実行している TaskList と、このタスクに対応する Task - TaskListPtr list; + TaskList* list; // Task の、Tasklist での位置 TaskPtr cur_index;