Mercurial > hg > Members > kono > Cerium
changeset 58:7492eb28b577
*** empty log message ***
author | gongo |
---|---|
date | Sat, 16 Feb 2008 19:40:20 +0900 |
parents | 1f8a23cdeec3 |
children | 16f9f6251f49 |
files | TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Fifo/Makefile TaskManager/Fifo/spe-main.cc TaskManager/Makefile.cell TaskManager/Makefile.def TaskManager/kernel/ppe/TaskManagerImpl.cc include/TaskManager/BufferManager.h include/TaskManager/CellBufferManager.h include/TaskManager/CellDmaManager.h include/TaskManager/CellScheduler.h include/TaskManager/CellTaskListInfo.h include/TaskManager/CellTaskManagerImpl.h include/TaskManager/DmaBuffer.h include/TaskManager/FifoTaskManagerImpl.h include/TaskManager/TaskManagerImpl.h include/TaskManager/types.h |
diffstat | 16 files changed, 85 insertions(+), 90 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Sat Feb 16 19:40:20 2008 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Sat Feb 16 19:40:20 2008 +0900 @@ -4,19 +4,13 @@ #include "FifoTaskManagerImpl.h" #include "types.h" -FifoTaskManagerImpl::~FifoTaskManagerImpl(void) -{ - delete taskInfo; - delete mailManager; -} - void FifoTaskManagerImpl::init(void) { TaskManagerImpl::init(); - taskInfo = new BufferManager; - taskInfo->init(); + bufferManager = new BufferManager; + bufferManager->init(); } void
--- a/TaskManager/Fifo/Makefile Sat Feb 16 19:40:20 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -SRCS = $(wildcard *.cpp) -OBJS = $(SRCS:.cpp=.o) - -CC = g++ -CFLAGS = -Wall -g -O2 -LIBS = - -.SUFFIXES: .cpp .o - -.cpp.o: - $(CC) $(CFLAGS) -c $< - -all: $(OBJS) - -clean: - rm -f *~ \#* - rm -f $(OBJS) \ No newline at end of file
--- a/TaskManager/Fifo/spe-main.cc Sat Feb 16 19:40:20 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -#include <stdio.h> -#include <unistd.h> -#include "SpeManager.h" -#include "FifoDmaManager.h" -#include "MailManager.h" - - -/** - * src/ppe/fifo/fifo_manager_impl.cpp から extern でリンクされる(はず... - */ -MailQueuePtr -spe_main(MailManager* _mailManager, MailQueuePtr mail_list) -{ - SpeManager *manager; - FifoDmaManager *connect; - MailQueuePtr ret; - - manager = new SpeManager(); - connect = new FifoDmaManager(); - - connect->mail_recvQueue = mail_list; - connect->mail_sendQueue = NULL; - connect->mailManager = _mailManager; - manager->set_connect((DmaManager*)connect); - -#ifdef _PPE_DEBUG - printf("[FIFO] finish\n"); -#endif - - manager->init(); - manager->run(); - manager->finish(); - - ret = connect->mail_sendQueue; - - delete connect; - delete manager; - - return ret; -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Makefile.cell Sat Feb 16 19:40:20 2008 +0900 @@ -0,0 +1,13 @@ +include ./Makefile.def + +.SUFFIXES: .cpp .o + +.cpp.o: + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +all: default +default: $(TARGET) + +ALL_OBJS = $(KERN_PPE_OBJS) $(KERN_SCHED_OBJS) $(IMPL_CELL_OBJS) +$(TARGET): $(ALL_OBJS) + ar crus $@ $(ALL_OBJS)
--- a/TaskManager/Makefile.def Sat Feb 16 19:40:20 2008 +0900 +++ b/TaskManager/Makefile.def Sat Feb 16 19:40:20 2008 +0900 @@ -11,9 +11,9 @@ KERN_SCHED_SRCS = $(wildcard $(KERN_SCHED_DIR)/*.cpp) KERN_SCHED_OBJS = $(KERN_SCHED_SRCS:.cpp=.o) -KERN_SPE_DIR = $(KERN_DIR)/spe -KERN_SPE_SRCS = $(wildcard $(KERN_SPE_DIR)/*.cpp) -KERN_SPE_OBJS = $(KERN_SPE_SRCS:.cpp=.o) +#KERN_SPE_DIR = $(KERN_DIR)/spe +#KERN_SPE_SRCS = $(wildcard $(KERN_SPE_DIR)/*.cpp) +#KERN_SPE_OBJS = $(KERN_SPE_SRCS:.cpp=.o) IMPL_FIFO_DIR = Fifo IMPL_FIFO_SRCS = $(wildcard $(IMPL_FIFO_DIR)/*.cpp)
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Sat Feb 16 19:40:20 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Sat Feb 16 19:40:20 2008 +0900 @@ -14,7 +14,7 @@ { delete mailManager; delete scheduler; - delete taskInfo; + delete bufferManager; } void @@ -34,7 +34,7 @@ { HTaskPtr new_task; - new_task = taskInfo->create_task(cmd, size, in_addr, out_addr); + new_task = bufferManager->create_task(cmd, size, in_addr, out_addr); if (func == NULL) { new_task->post_func = noaction; @@ -54,8 +54,8 @@ { TaskQueuePtr m, s; - m = taskInfo->create_taskQueue(master); - s = taskInfo->create_taskQueue(slave); + m = bufferManager->create_taskQueue(master); + s = bufferManager->create_taskQueue(slave); master->wait_me = TaskQueueInfo::append(master->wait_me, s); slave->wait_i = TaskQueueInfo::append(slave->wait_i, m); @@ -65,9 +65,9 @@ TaskManagerImpl::spawn_task(HTaskPtr task) { if (task->wait_i == NULL) { - taskInfo->append_activeTask(task); + bufferManager->append_activeTask(task); } else { - taskInfo->append_waitTask(task); + bufferManager->append_waitTask(task); } } @@ -81,15 +81,15 @@ HTaskPtr htask; TaskPtr task; - queue = taskInfo->activeTaskQueue; + queue = bufferManager->activeTaskQueue; if (queue == NULL) { return NULL; } - taskInfo->clear_taskList(); + bufferManager->clear_taskList(); while (queue) { - list = taskInfo->get_available_taskList(); + list = bufferManager->get_available_taskList(); htask = queue->task; d = queue; queue = queue->next; @@ -116,10 +116,10 @@ task->in_size = htask->in_size; task->self = htask; - taskInfo->free_taskQueue(d); + bufferManager->free_taskQueue(d); } - taskInfo->activeTaskQueue = NULL; + bufferManager->activeTaskQueue = NULL; return list; } @@ -176,7 +176,7 @@ } } else { __debug_ppe("[PPE] recv from : 0x%x\n", data); - taskInfo->check_task_finish((HTaskPtr)data); + bufferManager->check_task_finish((HTaskPtr)data); } d = q;
--- a/include/TaskManager/BufferManager.h Sat Feb 16 19:40:20 2008 +0900 +++ b/include/TaskManager/BufferManager.h Sat Feb 16 19:40:20 2008 +0900 @@ -42,7 +42,7 @@ TaskListPtr *machineTaskList; /* function */ - void init(void); + virtual void init(void); TaskQueuePtr create_taskQueue(HTaskPtr); HTaskPtr create_task(int cmd, int siz, DmaBuffer *in, DmaBuffer *out);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/TaskManager/CellBufferManager.h Sat Feb 16 19:40:20 2008 +0900 @@ -0,0 +1,20 @@ +#ifndef INCLUDED_CELL_BUFFER_MANAGER +#define INCLUDED_CELL_BUFFER_MANAGER + +#ifndef INCLUDED_BUFFER_MANAGER +# include "BufferManager.h" +#endif + +class CellBufferManager : public BufferManager { +public: + void init(void); + +#if 0 + virtual TaskListPtr get_available_taskList(void); + virtual void clear_taskList(void); + virtual void append_activeTask(HTaskPtr); + virtual void append_waitTask(HTaskPtr); +#endif +}; + +#endif
--- a/include/TaskManager/CellDmaManager.h Sat Feb 16 19:40:20 2008 +0900 +++ b/include/TaskManager/CellDmaManager.h Sat Feb 16 19:40:20 2008 +0900 @@ -11,7 +11,6 @@ void dma_load(void *buf, unsigned int addr, int size, int mask); void dma_store(void *buf, unsigned int addr, int size, int mask); void dma_wait(int mask) ; - void mail_write(unsigned int data); unsigned int mail_read(void); };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/TaskManager/CellScheduler.h Sat Feb 16 19:40:20 2008 +0900 @@ -0,0 +1,13 @@ +#ifndef INCLUDED_CELL_SCHEDULER +#define INCLUDED_CELL_SCHEDULER + +#ifndef INCLUDED_SCHEDULER +# include "Scheduler.h" +#endif + +class CellScheduler : public Scheduler { +public: + void init_impl(void); +}; + +#endif
--- a/include/TaskManager/CellTaskListInfo.h Sat Feb 16 19:40:20 2008 +0900 +++ b/include/TaskManager/CellTaskListInfo.h Sat Feb 16 19:40:20 2008 +0900 @@ -5,10 +5,10 @@ # include "TaskListInfo.h" #endif -class CellTaskListInfo : public TaskLisInfo { +class CellTaskListInfo : public TaskListInfo { public: /* functions */ - virtual int extend_pool(int num); + int extend_pool(int num); }; #endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/TaskManager/CellTaskManagerImpl.h Sat Feb 16 19:40:20 2008 +0900 @@ -0,0 +1,16 @@ +#ifndef INCLUDED_CELL_TASK_MANAGER_IMPL +#define INCLUDED_CELL_TASK_MANAGER_IMPL + +#ifndef INCLUDED_TASK_MANAGER_IMPL +# include "TaskManagerImpl.h" +#endif + +class CellTaskManagerImpl : public TaskManagerImpl { +public: + /* functions */ + void init(void); + void run(void); + void spawn_task(HTaskPtr); +}; + +#endif
--- a/include/TaskManager/DmaBuffer.h Sat Feb 16 19:40:20 2008 +0900 +++ b/include/TaskManager/DmaBuffer.h Sat Feb 16 19:40:20 2008 +0900 @@ -13,7 +13,6 @@ /* functions */ void swap_buffer(void); - //void* get_buffer(void); void get_buffer(void*); };
--- a/include/TaskManager/FifoTaskManagerImpl.h Sat Feb 16 19:40:20 2008 +0900 +++ b/include/TaskManager/FifoTaskManagerImpl.h Sat Feb 16 19:40:20 2008 +0900 @@ -7,13 +7,9 @@ class FifoTaskManagerImpl : public TaskManagerImpl { public: - /* constructor */ - ~FifoTaskManagerImpl(void); - /* functions */ void init(void); void run(void); - void spawn_task(HTaskPtr); };
--- a/include/TaskManager/TaskManagerImpl.h Sat Feb 16 19:40:20 2008 +0900 +++ b/include/TaskManager/TaskManagerImpl.h Sat Feb 16 19:40:20 2008 +0900 @@ -24,7 +24,7 @@ MailManager *mailManager; MainScheduler *scheduler; - BufferManager *taskInfo; + BufferManager *bufferManager; /* functions */ virtual void init(void);
--- a/include/TaskManager/types.h Sat Feb 16 19:40:20 2008 +0900 +++ b/include/TaskManager/types.h Sat Feb 16 19:40:20 2008 +0900 @@ -13,6 +13,8 @@ (((value) + ((alignment) - 1))&(~((alignment)-1))) #define DEFAULT_ALIGNMENT SPE_ALIGNMENT +#define DMA_MAX_SIZE 16384 + enum { MY_SPE_COMMAND_EXIT, MY_SPE_COMMAND_GO,