diff TaskManager/kernel/schedule/SchedTaskList.cc @ 42:aa11038dbdc1

*** empty log message ***
author gongo
date Thu, 14 Feb 2008 18:27:37 +0900
parents
children 504899860e66
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/kernel/schedule/SchedTaskList.cc	Thu Feb 14 18:27:37 2008 +0900
@@ -0,0 +1,40 @@
+#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);
+}
+
+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 を作ればいい。。。はず
+	return new SchedTask(list, &list->tasks[--list->length],
+			   m->get_curReadBuf(),
+			   m->get_curWriteBuf(),
+			   connector);
+    }
+}