Mercurial > hg > Members > kono > Cerium
diff TaskManager/Cell/spe/SchedTaskList.cc @ 81:b03a4d3565c0
*** empty log message ***
author | gongo |
---|---|
date | Wed, 20 Feb 2008 17:07:11 +0900 |
parents | |
children | 504899860e66 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Cell/spe/SchedTaskList.cc Wed Feb 20 17:07:11 2008 +0900 @@ -0,0 +1,48 @@ +#include "SchedTaskList.h" +#include "SchedTask.h" +#include "SchedNop2Ready.h" +#include "DmaManager.h" +#include "error.h" + +SchedTaskList::SchedTaskList(unsigned int addr, TaskListPtr listbuf, DmaManager* c) +{ + params_addr = addr; + list = listbuf; + connector = c; +} + +void +SchedTaskList::read(void) +{ + __debug("[SchedTaskList:%s]\n", __FUNCTION__); + + connector->dma_load(list, params_addr, sizeof(TaskList), DMA_READ); + connector->dma_wait(DMA_READ); +} + +extern SchedTask* CreateSchedTask(TaskListPtr, void*, void*, DmaManager*); + +SchedTaskBase* +SchedTaskList::next(Scheduler *m, SchedTaskBase *p) +{ + __debug("[SchedTaskList:%s]\n", __FUNCTION__); + + delete p; + + if (list->length < 1) { + return new SchedNop2Ready(connector); + } else { + // 本当は、ここで task->command に対応する、 + // SchedTask を継承する class を作ればいい。。。はず +#if 0 + return new SchedTask(list, &list->tasks[--list->length], + m->get_curReadBuf(), + m->get_curWriteBuf(), + connector); +#else + return CreateSchedTask(list, m->get_curReadBuf(), m->get_curWriteBuf(), + connector); +#endif + } +} +