changeset 812:ff684304e1d3

fix Cell
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 May 2010 00:23:46 +0900
parents 76a39ad68846
children f3f982bc271c
files TaskManager/Cell/CellTaskListInfo.cc TaskManager/Cell/CellTaskListInfo.h TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/kernel/ppe/TaskListInfo.cc
diffstat 4 files changed, 7 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskListInfo.cc	Sat May 22 23:23:29 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "CellTaskListInfo.h"
-
-#define NEXT_ADDR(addr, size) \
-    (TaskListPtr)((memaddr)(addr) + (size))
-
-int
-TaskListInfo::extend_pool(int num)
-{
-    TaskListPtr q;
-    int unit_size;
-    
-    unit_size = (ROUND_UP_ALIGN(sizeof(TaskList), DEFAULT_ALIGNMENT));
-    posix_memalign((void**)&q, DEFAULT_ALIGNMENT, unit_size*(num+1));
-
-    // First Queue is previous pool
-    q->waiter = waiter; waiter = q;
-    q++;
-
-    /* Connect all free queue in the pool */
-    TaskListPtr p = q;
-    for (; num-- > 0; p++) {
-	p->waiter = NULL;
-	taskListPool.addLast(p);
-    }
-
-    return 0;
-}
-
-/* end */
--- a/TaskManager/Cell/CellTaskListInfo.h	Sat May 22 23:23:29 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#ifndef INCLUDED_CELL_TASK_LIST_INFO
-#define INCLUDED_CELL_TASK_LIST_INFO
-
-#include "TaskListInfo.h"
-
-class CellTaskListInfo : public TaskListInfo {
-public:
-    /* functions */
-    int extend_pool(int num);
-};
-
-#endif
--- a/TaskManager/Cell/CellTaskManagerImpl.cc	Sat May 22 23:23:29 2010 +0900
+++ b/TaskManager/Cell/CellTaskManagerImpl.cc	Sun May 23 00:23:46 2010 +0900
@@ -4,7 +4,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include "CellTaskManagerImpl.h"
-#include "CellTaskListInfo.h"
 #include "HTaskInfo.h"
 #include "SchedTask.h"
 #include "MainScheduler.h"
@@ -25,8 +24,6 @@
 CellTaskManagerImpl::init()
 {
     spe_running = 0;
-    taskListImpl = new CellTaskListInfo;
-
 
     activeTaskQueue = new HTaskInfo();
 
@@ -36,8 +33,10 @@
     speThreads->init();
 
     speTaskList  = new TaskListInfoPtr[machineNum];
+    taskListInfo  = new TaskListInfoPtr[machineNum];
 
     for (int i = 0; i < machineNum; i++) {
+	taskListInfo[i] = new TaskListInfo();
 	speTaskList[i] = new TaskListInfo();
     }
 
@@ -216,7 +215,8 @@
     speTaskList[id] = tmp;
 
     tmp->getLast()->next = 0;
-    speThreads->send_mail(id, 1, (memaddr *)tmp->getFirst());
+    TaskListPtr p = tmp->getFirst();
+    speThreads->send_mail(id, 1, (memaddr *)&p);
 }
 
 void CellTaskManagerImpl::show_profile() {
--- a/TaskManager/kernel/ppe/TaskListInfo.cc	Sat May 22 23:23:29 2010 +0900
+++ b/TaskManager/kernel/ppe/TaskListInfo.cc	Sun May 23 00:23:46 2010 +0900
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "types.h"
 #include "TaskListInfo.h"
 
 
@@ -26,10 +27,11 @@
 int
 TaskListInfo::extend_pool(int num)
 {
-    TaskListPtr q = (TaskListPtr)malloc(sizeof(TaskList)*(num+1));
+    TaskListPtr q = (TaskListPtr)malloc(sizeof(TaskList)*(num+1)+DEFAULT_ALIGNMENT);
 
     // First Queue is previous pool
     q->waiter = waiter; waiter = q;
+    q = (TaskListPtr)ROUND_UP_ALIGN((long)q, DEFAULT_ALIGNMENT);
     q++;
 
     /* Connect all free queue in the pool */