# HG changeset patch # User gongo # Date 1202265668 -32400 # Node ID 39ce245235d4bf26c5ae341ae5b1852fc7d88917 # Parent 75f184d16fa523dbb10f203aee1f83a53f4a9399 *** empty log message *** diff -r 75f184d16fa5 -r 39ce245235d4 TaskManager/Fifo/FifoTaskInfo.cc --- a/TaskManager/Fifo/FifoTaskInfo.cc Tue Feb 05 23:32:43 2008 +0900 +++ b/TaskManager/Fifo/FifoTaskInfo.cc Wed Feb 06 11:41:08 2008 +0900 @@ -5,9 +5,20 @@ void FifoTaskInfo::init(void) { - init_pool_taskQueue(TASK_MAX_SIZE*4); - init_pool_task(TASK_MAX_SIZE); - init_pool_taskList(2); + taskListPool = NULL; + freeTaskList = NULL; + + taskQueuePool = NULL; + freeTaskQueue = NULL; + activeTaskQueue = NULL; + waitTaskQueue = NULL; + + taskPool = NULL; + freeTask = NULL; + + init_taskList(2); + init_taskQueue(TASK_MAX_SIZE*4); + init_task(TASK_MAX_SIZE); machineTaskList = get_free_taskList(); } @@ -15,7 +26,7 @@ int FifoTaskInfo::extend_pool_taskList(int num) { - TaskListPtr q; + TaskListPtr q = NULL; q = (TaskListPtr)malloc(sizeof(TaskList)*(num+1)); @@ -27,8 +38,7 @@ taskListPool = q; /* Connect all free pack_list in the pool */ - q = taskListPool + 1; - for (q = taskListPool + 1; num-- > 0; q++) { + for (q = taskListPool + 1; --num > 0; q++) { q->next = q + 1; } q->next = freeTaskList; diff -r 75f184d16fa5 -r 39ce245235d4 TaskManager/Fifo/MailManager.cc --- a/TaskManager/Fifo/MailManager.cc Tue Feb 05 23:32:43 2008 +0900 +++ b/TaskManager/Fifo/MailManager.cc Wed Feb 06 11:41:08 2008 +0900 @@ -16,7 +16,6 @@ { MailQueuePtr q; - //q = new MailQueue[num+1]; q = (MailQueuePtr)malloc(sizeof(MailQueue)*(num+1)); if (q == NULL) { @@ -26,8 +25,7 @@ mailQueuePool = q; /* Connect all free queue in the pool */ - q = mailQueuePool + 1; - for (q = mailQueuePool + 1; num-- > 0; q++) { + for (q = mailQueuePool + 1; --num > 0; q++) { q->next = q + 1; } q->next = freeMailQueue; diff -r 75f184d16fa5 -r 39ce245235d4 TaskManager/Makefile.def --- a/TaskManager/Makefile.def Tue Feb 05 23:32:43 2008 +0900 +++ b/TaskManager/Makefile.def Wed Feb 06 11:41:08 2008 +0900 @@ -19,7 +19,7 @@ IMPL_CELL_SRCS = $(wildcard $(IMPL_CELL_DIR)/*.cpp) IMPL_CELL_OBJS = $(IMPL_CELL_SRCS:.cpp=.o) -CC = ccmalloc --no-wrapper g++ +CC = g++ CFLAGS = -Wall -g LIBS = diff -r 75f184d16fa5 -r 39ce245235d4 TaskManager/Test/Sum/Makefile --- a/TaskManager/Test/Sum/Makefile Tue Feb 05 23:32:43 2008 +0900 +++ b/TaskManager/Test/Sum/Makefile Wed Feb 06 11:41:08 2008 +0900 @@ -1,9 +1,8 @@ TARGET = main -CC = ccmalloc --no-wrapper g++ +CC = g++ CFLAGS = -Wall -O2 -g -LIBS = -L../../ -lmanager ~/src/ccmalloc-0.4.0/obj/ccmalloc-g++.o \ - ~/src/ccmalloc-0.4.0/lib/libccmalloc.a -ldl +LIBS = -L../../ -lmanager INCLUDE = -I../../../include/TaskManager diff -r 75f184d16fa5 -r 39ce245235d4 TaskManager/kernel/ppe/TaskInfo.cc --- a/TaskManager/kernel/ppe/TaskInfo.cc Tue Feb 05 23:32:43 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskInfo.cc Wed Feb 06 11:41:08 2008 +0900 @@ -12,10 +12,8 @@ * @return if (success) ? 0 : -1 */ int -TaskInfo::init_pool_taskList(int num) +TaskInfo::init_taskList(int num) { - printf("pool_taskList: %d\n", num); - if (!taskListPool) { return extend_pool_taskList(num); } @@ -34,7 +32,7 @@ extend_pool_taskList(10); } q = freeTaskList; - freeTaskList = (TaskListPtr)freeTaskList->next; + freeTaskList = freeTaskList->next; q->length = 0; q->next = 0; @@ -47,10 +45,8 @@ * @return if (success) ? 0 : -1 */ int -TaskInfo::init_pool_taskQueue(int num) +TaskInfo::init_taskQueue(int num) { - printf("pool_taskQueue: %d\n", num); - if (!taskQueuePool) { return extend_pool_taskQueue(num); } @@ -60,9 +56,8 @@ int TaskInfo::extend_pool_taskQueue(int num) { - TaskQueuePtr q; + TaskQueuePtr q = NULL; - //q = new TaskQueue[num+1]; q = (TaskQueuePtr)malloc(sizeof(TaskQueue)*(num+1)); if (q == NULL) { @@ -72,8 +67,7 @@ taskQueuePool = q; /* Connect all free queue in the pool */ - q = taskQueuePool + 1; - for (q = taskQueuePool + 1; num-- > 0; q++) { + for (q = taskQueuePool + 1; --num > 0; q++) { q->next = q + 1; } q->next = freeTaskQueue; @@ -101,10 +95,8 @@ int -TaskInfo::init_pool_task(int num) +TaskInfo::init_task(int num) { - printf("pool_task: %d\n", num); - if (!taskPool) { return extend_pool_task(num); } @@ -114,9 +106,8 @@ int TaskInfo::extend_pool_task(int num) { - HTaskPtr q; + HTaskPtr q = NULL; - //q = new HTask[num+1]; q = (HTaskPtr)malloc(sizeof(HTask)*(num+1)); if (q == NULL) { @@ -126,8 +117,7 @@ taskPool = q; /* Connect all free queue in the pool */ - q = taskPool + 1; - for (q = taskPool + 1; num-- > 0; q++) { + for (q = taskPool + 1; --num > 0; q++) { q->next = q + 1; } q->next = freeTask; diff -r 75f184d16fa5 -r 39ce245235d4 TaskManager/kernel/spe/SpeManager.cc --- a/TaskManager/kernel/spe/SpeManager.cc Tue Feb 05 23:32:43 2008 +0900 +++ b/TaskManager/kernel/spe/SpeManager.cc Wed Feb 06 11:41:08 2008 +0900 @@ -1,4 +1,5 @@ #include +#include // 絶対 Fix me // memalign のためにこんなことに・・・ diff -r 75f184d16fa5 -r 39ce245235d4 include/TaskManager/TaskInfo.h --- a/include/TaskManager/TaskInfo.h Tue Feb 05 23:32:43 2008 +0900 +++ b/include/TaskManager/TaskInfo.h Wed Feb 06 11:41:08 2008 +0900 @@ -27,18 +27,18 @@ virtual void init(void) = 0; // task list - int init_pool_taskList(int num); + int init_taskList(int num); virtual int extend_pool_taskList(int num) = 0; virtual TaskListPtr get_available_taskList(void) = 0; TaskListPtr get_free_taskList(void); // task queue - int init_pool_taskQueue(int num); + int init_taskQueue(int num); TaskQueuePtr get_free_taskQueue(HTaskPtr); int extend_pool_taskQueue(int num); // task - int init_pool_task(int num); + int init_task(int num); int extend_pool_task(int num); HTaskPtr get_free_task(int cmd, int size, unsigned long long in_addr,