Mercurial > hg > Game > Cerium
diff TaskManager/kernel/schedule/SchedTaskList.cc @ 109:028ffc9c0375 draft
Cerium cvs version
author | gongo@gendarme.local |
---|---|
date | Wed, 12 Nov 2008 17:39:33 +0900 |
parents | 504899860e66 |
children | a19d3ed4ce5b |
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/SchedTaskList.cc Wed Nov 12 17:29:35 2008 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskList.cc Wed Nov 12 17:39:33 2008 +0900 @@ -1,23 +1,36 @@ +#include <stdlib.h> +#include <string.h> #include "SchedTaskList.h" #include "SchedTask.h" #include "SchedNop2Ready.h" #include "DmaManager.h" #include "error.h" -SchedTaskList::SchedTaskList(unsigned int addr, TaskListPtr listbuf, DmaManager* c) +SchedTaskList::SchedTaskList(unsigned int addr, Scheduler *sched) { params_addr = addr; - list = listbuf; - connector = c; + list = sched->get_curListBuf(); + scheduler = sched; + + flag_renewTaskList = 0; } + void SchedTaskList::read(void) { __debug("[SchedTaskList:%s]\n", __FUNCTION__); - connector->dma_load(list, params_addr, sizeof(TaskList), DMA_READ); - connector->dma_wait(DMA_READ); + if (flag_renewTaskList == 0) { + scheduler->dma_load(list,params_addr,sizeof(TaskList),DMA_READ_TASKLIST); + scheduler->dma_wait(DMA_READ_TASKLIST); + } else { + list = (TaskListPtr)params_addr; + } + + scheduler->curIndex_taskList = 0; + + scheduler->mainMem_wait(); } SchedTaskBase* @@ -28,14 +41,12 @@ delete p; if (list->length < 1) { - return new SchedNop2Ready(connector); + return new SchedNop2Ready(scheduler); } else { - // 本当は、ここで task->command に対応する、 - // SchedTask を継承する class を作ればいい。。。はず - return new SchedTask(list, &list->tasks[--list->length], - m->get_curReadBuf(), - m->get_curWriteBuf(), - connector); + SchedTask* task = CreateSchedTask(list, m); + task->__flag_renewTask = this->flag_renewTaskList; + task->__init__(); + return task; } }