Mercurial > hg > Members > kono > Cerium
view TaskManager/kernel/schedule/SchedTaskList.cc @ 703:61b59376aec5
compatibility
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 14 Dec 2009 18:34:46 +0900 |
parents | 9a6cb2439593 |
children | 6d497c098455 |
line wrap: on
line source
#include <stdlib.h> #include <string.h> #include "SchedTaskList.h" #include "SchedTask.h" #include "SchedNop2Ready.h" #include "DmaManager.h" #include "error.h" /** * SchedTaskList を返す * * @param[in] next_list 次の実行する TaskList のアドレス * @param[in] next_list がメインメモリのアドレスか、 * SPE で生成されたアドレスかのフラグ * SPE で生成されている場合、DMA の必要は無い * 0: メインメモリ, 1: SPE */ SchedTaskList* createSchedTaskList(memaddr next_list, Scheduler* scheduler, int renew_flag) { SchedTaskList* sched = new SchedTaskList(next_list, scheduler); return sched; } SchedTaskList::SchedTaskList(memaddr addr, Scheduler *sched) { params_addr = addr; list = NULL; scheduler = sched; } void SchedTaskList::read() { __debug("[SchedTaskList:%s]\n", __FUNCTION__); list = scheduler->get_curListBuf(); scheduler->dma_load(list, params_addr, sizeof(TaskList), DMA_READ_TASKLIST); } SchedTaskBase* SchedTaskList::next(Scheduler *scheduler, SchedTaskBase *p) { SchedTaskBase *nextSched; __debug("[SchedTaskList:%s]\n", __FUNCTION__); scheduler->dma_wait(DMA_READ_TASKLIST); if (list->length < 1) { nextSched = new SchedNop2Ready(scheduler); } else { #ifdef SIMPLE_TASK SimpleTaskPtr nextTask = &list->tasks[0]; #else TaskPtr nextTask = &list->tasks[0]; #endif nextSched = createSchedTask(scheduler, nextTask); ((SchedTask*)nextSched)->init(list, nextTask, 1, scheduler); } return nextSched; } /* end */