diff TaskManager/kernel/schedule/Scheduler.cc @ 442:95a856a2d552

hoge... size/count
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 25 Sep 2009 04:40:31 +0900
parents 7bae2117f239
children 4f11245e3504
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/Scheduler.cc	Fri Sep 25 03:49:01 2009 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.cc	Fri Sep 25 04:40:31 2009 +0900
@@ -329,10 +329,10 @@
  *  Task load API
  */
 void
-Scheduler::allocate_code_segment(int count, int size)
+Scheduler::allocate_code_segment(int size, int count)
 {
     // 既に overlay 領域があるので、それを追加する必要がある...
-    code_segment_pool = createMemList(count, size);
+    code_segment_pool = createMemList(size, count);
 }
 
 static void
@@ -354,7 +354,11 @@
 static void
 wait_load(Scheduler *m, int task_id)
 {
-    fprintf(stderr,"wait load task id %d\n",task_id);
+    MemorySegment *s = task_list[task_id].segment;
+    if (s)
+	fprintf(stderr,"wait load task id %d 0x%x\n",task_id,(int)s->data);
+    else
+	fprintf(stderr,"wait load task id %d 000000\n",task_id);
     // wait for code segment load
     m->wait_segment(task_list[task_id].segment);
     // calcurate call address
@@ -388,6 +392,7 @@
 {
     task_list[cmd].creator = creator;
     task_list[cmd].location = start;
+    size &= 0xfffffffe;
     task_list[cmd].end = start+size;
     task_list[cmd].entry_offset = entry_offset;
     task_list[cmd].load = load_task;
@@ -485,7 +490,9 @@
 uint32
 Scheduler::get_tag()
 {
-    return 0;
+    static int tag = 0;
+    tag = tag++ & 0x1f;
+    return tag;
 }
 
 /*!