changeset 1288:b194cb2d44bb draft

add choose function
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Tue, 29 Nov 2011 18:02:07 +0900
parents d126621d99b6
children 1486f2d17e4a
files TaskManager/Fifo/MainScheduler.cc TaskManager/kernel/main.cc
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Fifo/MainScheduler.cc	Tue Nov 29 17:42:28 2011 +0900
+++ b/TaskManager/Fifo/MainScheduler.cc	Tue Nov 29 18:02:07 2011 +0900
@@ -4,15 +4,18 @@
 #include "TaskManagerImpl.h"
 #include "FifoDmaManager.h"
 #include "ReferencedDmaManager.h"
+#include "PreRefDmaManager.h"
 #include "error.h"
 
 void
 MainScheduler::init_impl(int useRefDma)
 {
-	if (useRefDma == 0) {
+	if (useRefDma & 0x10) {
+		fifoDmaManager = new PreRefDmaManager();
+	} else if (useRefDma & 0x01) {
+		fifoDmaManager = new ReferencedDmaManager();
+	} else {
 		fifoDmaManager = new FifoDmaManager();
-	} else {
-		fifoDmaManager = new ReferencedDmaManager();
 	}
     connector = fifoDmaManager;
 }
--- a/TaskManager/kernel/main.cc	Tue Nov 29 17:42:28 2011 +0900
+++ b/TaskManager/kernel/main.cc	Tue Nov 29 18:02:07 2011 +0900
@@ -48,7 +48,9 @@
         } else if (strcmp(argv[i], "-poll") == 0) {
 			poll_pattern = 1;
 		} else if (strcmp(argv[i], "-ref") == 0) {
-			useRefDma = 1;
+			useRefDma |= 0x01;
+		} else if (strcmp(argv[i], "-pre") == 0) {
+			useRefDma |= 0x10;
 		}
 	}