# HG changeset patch # User Shinji KONO # Date 1274541826 -32400 # Node ID ff684304e1d386e1ab62a58fa05c6b42c710c91f # Parent 76a39ad68846345bdb3461c8c7f859617477c2c6 fix Cell diff -r 76a39ad68846 -r ff684304e1d3 TaskManager/Cell/CellTaskListInfo.cc --- 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 -#include -#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 */ diff -r 76a39ad68846 -r ff684304e1d3 TaskManager/Cell/CellTaskListInfo.h --- 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 diff -r 76a39ad68846 -r ff684304e1d3 TaskManager/Cell/CellTaskManagerImpl.cc --- 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 #include #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() { diff -r 76a39ad68846 -r ff684304e1d3 TaskManager/kernel/ppe/TaskListInfo.cc --- 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 #include +#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 */