changeset 1612:42f260639cc0 draft

fix
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Thu, 09 May 2013 20:51:22 +0900
parents 6c8f9791262e
children 0d368b575bb5
files TaskManager/kernel/ppe/CpuThreads.cc TaskManager/kernel/ppe/CpuThreads.h TaskManager/kernel/schedule/Scheduler.cc example/basic/main.cc
diffstat 4 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/CpuThreads.cc	Thu May 09 20:04:26 2013 +0900
+++ b/TaskManager/kernel/ppe/CpuThreads.cc	Thu May 09 20:51:22 2013 +0900
@@ -56,8 +56,8 @@
     TaskManagerImpl *manager = new SpeTaskManagerImpl();
     c_scheduler->init(manager,argt->useRefDma);
     c_scheduler->id = (int)argt->cpuid;
-    c_scheduler->mincpu = id_offset;
-    c_scheduler->maxcpu = cpu_num + id_offset;
+    c_scheduler->mincpu = (int)argt->id_offset;
+    c_scheduler->maxcpu = (int)argt->cpu_num + (int)argt->id_offset;
     manager->set_scheduler(c_scheduler);
     SchedRegister(ShowTime);
     SchedRegister(StartProfile);
@@ -85,6 +85,8 @@
         args[i].scheduler = new MainScheduler();
         args[i].wait = wait;
         args[i].useRefDma = use_refdma;
+        args[i].id_offset = id_offset;
+        args[i].cpu_num = cpu_num;
     }
 
     for (int i = 0; i < cpu_num; i++) {
--- a/TaskManager/kernel/ppe/CpuThreads.h	Thu May 09 20:04:26 2013 +0900
+++ b/TaskManager/kernel/ppe/CpuThreads.h	Thu May 09 20:51:22 2013 +0900
@@ -10,6 +10,8 @@
 
 typedef struct cpu_arg {
     int cpuid;
+    int id_offset;
+    int cpu_num;
     // should be syncrhonized
     MainScheduler *scheduler;
     TaskManagerImpl *manager;
--- a/TaskManager/kernel/schedule/Scheduler.cc	Thu May 09 20:04:26 2013 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.cc	Thu May 09 20:51:22 2013 +0900
@@ -417,7 +417,7 @@
 int
 Scheduler::max_cpu()
 { // todo
-    return maxcpu;
+    return maxcpu-1;
 }
 
 int
--- a/example/basic/main.cc	Thu May 09 20:04:26 2013 +0900
+++ b/example/basic/main.cc	Thu May 09 20:51:22 2013 +0900
@@ -91,7 +91,7 @@
     /*
      * set_post() で ppe task を渡せるようにしたい
      */
-    //    twice->set_post(twice_result, (void*)data, 0);
+    twice->set_post(twice_result, (void*)data, 0);
 
     // add Active Queue
     twice->iterate(length);
@@ -112,6 +112,6 @@
     for (int i = 0; i < task; ++i) {
         twice_init(manager);
     }
-
+    
     return 0;
 }