Mercurial > hg > Game > Cerium
changeset 4:3b57f13a207a
*** empty log message ***
author | gongo |
---|---|
date | Tue, 05 Feb 2008 20:34:53 +0900 |
parents | 2356238ebea7 |
children | 75f184d16fa5 |
files | TaskManager/Fifo/FifoDmaManager.h TaskManager/Fifo/FifoTaskInfo.h TaskManager/Fifo/FifoTaskManagerImpl.h TaskManager/Fifo/MailManager.h TaskManager/kernel/ppe/TaskInfo.h TaskManager/kernel/ppe/TaskManager.h TaskManager/kernel/ppe/TaskManagerImpl.h TaskManager/kernel/spe/DmaManager.h TaskManager/kernel/spe/SpeExit.h TaskManager/kernel/spe/SpeMail.h TaskManager/kernel/spe/SpeManager.h TaskManager/kernel/spe/SpeNop.h TaskManager/kernel/spe/SpeNop2Ready.h TaskManager/kernel/spe/SpeTask.h TaskManager/kernel/spe/SpeTaskList.h TaskManager/kernel/spe/error.h |
diffstat | 16 files changed, 0 insertions(+), 482 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoDmaManager.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#ifndef INCLUDED_FIFO_DMA_MANAGER -#define INCLUDED_FIFO_DMA_MANAGER - -#ifndef INCLUDED_DMA_MANAGER -# include "DmaManager.h" -#endif - -#ifndef INCLUDED_MAIL_MANAGER -# include "MailManager.h" -#endif - -class FifoDmaManager : public DmaManager { -public: - /* variables */ - MailManager *mailManager; - MailQueuePtr mail_recvQueue; - MailQueuePtr mail_sendQueue; - - /* functions */ - 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); -}; - -#endif
--- a/TaskManager/Fifo/FifoTaskInfo.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -#ifndef INCLUDED_FIFO_TASK_INFO -#define INCLUDED_FIFO_TASK_INFO - -#ifndef INCLUDED_TASK_INFO -# include "TaskInfo.h" -#endif - -class FifoTaskInfo : public TaskInfo { -public: - /* function */ - void init(void); - int extend_pool_taskList(int num); - TaskListPtr get_available_taskList(void); - void clear_taskList(void); - - /* variables */ - TaskListPtr machineTaskList; -}; - -#endif
--- a/TaskManager/Fifo/FifoTaskManagerImpl.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -#ifndef INCLUDED_FIFO_TASK_MANAGER_IMPL -#define INCLUDED_FIFO_TASK_MANAGER_IMPL - -#ifndef INCLUDED_FIFO_TASK_INFO -# include "FifoTaskInfo.h" -#endif - -#ifndef INCLUDED_TASK_MANAGER_IMPL -# include "TaskManagerImpl.h" -#endif - -#ifndef INCLUDED_MAIL_MANAGER -# include "MailManager.h" -#endif - -class FifoTaskManagerImpl : public TaskManagerImpl { -public: - /* functions */ - void init(void); - void run(void); - - TaskListPtr set_task(void); - -private: - /* variables */ - MailManager *mailManager; - - /* functions */ - MailQueuePtr mail_check(MailQueuePtr mail_list); -}; - -#endif
--- a/TaskManager/Fifo/MailManager.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -#ifndef INCLUDED_MAIL_MANAGER -#define INCLUDED_MAIL_MANAGER - -typedef struct mail_queue { - unsigned int data; - struct mail_queue *next; -} MailQueue, *MailQueuePtr; - -class MailManager { -public: - /* functions */ - int init_pool_mailQueue(int num); - int extend_pool_mailQueue(int num); - MailQueuePtr create_mail(unsigned int data); - MailQueuePtr get_free_mailQueue(unsigned int data); - void free_mailQueue(MailQueuePtr q); - -private: - /* variables */ - MailQueuePtr mailQueuePool; - MailQueuePtr freeMailQueue; -}; - -extern MailQueuePtr append_mailQueue(MailQueuePtr list, MailQueuePtr q); - -#endif
--- a/TaskManager/kernel/ppe/TaskInfo.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -#ifndef INCLUDED_TASK_INFO -#define INCLUDED_TASK_INFO - -#ifndef INCLUDED_TASK -# include "task.h" -#endif - -class TaskInfo { -public: - /* constructor */ - TaskInfo(int num = 1); - virtual ~TaskInfo(void) {} - - /* variables */ - TaskListPtr taskListPool; - TaskListPtr freeTaskList; - - TaskQueuePtr taskQueuePool; - TaskQueuePtr freeTaskQueue; - TaskQueuePtr waitTaskQueue; - TaskQueuePtr activeTaskQueue; - - /* function */ - virtual void init(void) = 0; - - // task list - int init_pool_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); - TaskQueuePtr get_free_taskQueue(HTaskPtr); - int extend_pool_taskQueue(int num); - - // task - int init_pool_task(int num); - HTaskPtr get_free_task(int cmd, int size, - unsigned long long in_addr, - unsigned long long out_addr); - - virtual void clear_taskList(void) = 0; - - void append_activeTask(HTaskPtr); - void append_waitTask(HTaskPtr); - - void free_taskList(TaskListPtr q); - void free_taskQueue(TaskQueuePtr q); - void free_task(HTaskPtr q); - - void check_task_finish(HTaskPtr task); - void notify_wait_taskQueue(HTaskPtr depend, TaskQueuePtr list); - TaskQueuePtr remove_taskQueue(TaskQueuePtr list, TaskQueuePtr task); - TaskQueuePtr remove_taskQueue_eq_task(TaskQueuePtr list, HTaskPtr task); - -private: - int machineNum; -}; - -extern TaskQueuePtr append_taskQueue(TaskQueuePtr, TaskQueuePtr); -extern TaskListPtr append_taskList(TaskListPtr list, TaskListPtr q); - -#endif
--- a/TaskManager/kernel/ppe/TaskManager.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -#ifndef INCLUDED_TASK_MANAGER -#define INCLUDED_TASK_MANAGER - -#ifndef INCLUDED_TASK_MANAGER_IMPL -# include "TaskManagerImpl.h" -#endif - -class TaskManager { -public: - /* constructor */ - TaskManager(int num = 1); // The number of threads - - /* variables */ - TaskManagerImpl *m_impl; - - /* functions */ - void init(void); - HTaskPtr create_task(int cmd, int siz, unsigned long long in_addr, - unsigned long long out_addr, void (*func)(void)); - void set_task_depend(HTaskPtr master, HTaskPtr slave); - void run_task(HTaskPtr); - void run(void); - -private: - int machineNum; -}; - -#endif
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -#ifndef INCLUDED_TASK_MANAGER_IMPL -#define INCLUDED_TASK_MANAGER_IMPL - -#ifndef INCLUDED_TASK_INFO -# include "TaskInfo.h" -#endif - -class TaskManagerImpl { -public: - /* constructor */ - TaskManagerImpl(int num = 1); - virtual ~TaskManagerImpl(void) {} - - /* variables */ - int machineNum; - TaskInfo* taskInfo; - - /* functions */ - virtual void init(void) = 0; - virtual void run(void) = 0; - - HTaskPtr create_task(int cmd, int siz, - unsigned long long in_addr, - unsigned long long out_addr, - void (*func)(void)); - void set_task_depend(HTaskPtr master, HTaskPtr slave); - void run_task(HTaskPtr); -}; -#endif
--- a/TaskManager/kernel/spe/DmaManager.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -#ifndef INCLUDED_DMA_MANAGER -#define INCLUDED_DMA_MANAGER - -enum dma_tag { - DMA_READ, - DMA_WRITE -}; - -#include "ppe_spe.h" - -class DmaManager { -public: - virtual ~DmaManager(void) {}; - - virtual void dma_load(void *buf, unsigned int addr,int size, int mask) = 0; - virtual void dma_store(void *buf,unsigned int addr,int size, int mask) = 0; - virtual void dma_wait(int mask) = 0; - - virtual void mail_write(unsigned int data) = 0; - virtual unsigned int mail_read(void) = 0; -}; - -#endif
--- a/TaskManager/kernel/spe/SpeExit.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -#ifndef INCLUDED_SPE_EXIT -#define INCLUDED_SPE_EXIT - -#ifndef INCLUDED_SPEMANAGER -# include "SpeManager.h" -#endif - -class SpeExit : public SpeTaskBase { -public: - /* constructor */ - SpeExit(void) {} - - /* variables */ - - /* functions */ - SpeTaskBase* next(SpeManager *, SpeTaskBase *); -}; - -#endif
--- a/TaskManager/kernel/spe/SpeMail.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -#ifndef INCLUDED_SPE_MAIL -#define INCLUDED_SPE_MAIL - -#ifndef INCLUDED_SPE_MANAGER -# include "SpeManager.h" -#endif - -class SpeMail : public SpeTaskBase{ -public: - /* constructor */ - SpeMail(DmaManager *); - - /* variables */ - unsigned int params_addr; - DmaManager* connector; - - /* functions */ - SpeTaskBase* next(SpeManager *, SpeTaskBase *); - - /* override functions */ - void read(void); // overwride - -#ifdef DEBUG - void exec(void); - void write(void); -#endif -}; - -#endif
--- a/TaskManager/kernel/spe/SpeManager.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -#ifndef INCLUDED_SPE_MANAGER -#define INCLUDED_SPE_MANAGER - -#ifndef INCLUDED_TASK -# include "task.h" -#endif - -#ifndef INCLUDED_DMA_MANAGER -# include "DmaManager.h" -#endif - -class SpeTaskBase; -class SpeManager; - -class SpeTaskBase { -public: - /* constructor */ - SpeTaskBase(void) {} - virtual ~SpeTaskBase(void) {} - - /* variables */ - - // noaction in default - virtual void load(void) {} - virtual void read(void) {} - virtual void exec(void) {} - virtual void write(void) {} - - /* functions */ - virtual SpeTaskBase* next(SpeManager *, SpeTaskBase *) = 0; -}; - - -class SpeManager { -public: - SpeManager(void); - - /* variables */ - int listBufFlg; - int readBufFlg; - int writeBufFlg; - TaskListPtr listBuf[2]; - void *readBuf[2]; - void *writeBuf[2]; - - DmaManager* connector; - - SpeTaskBase* task1; - SpeTaskBase* task2; - SpeTaskBase* task3; - - /* functions */ - void init(void); - void set_connect(DmaManager*); - void run(void); - void finish(void); - - TaskListPtr get_curListBuf(void); - void* get_curReadBuf(void); - void* get_curWriteBuf(void); -}; - -#endif
--- a/TaskManager/kernel/spe/SpeNop.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -#ifndef INCLUDED_SPE_NOP -#define INCLUDED_SPE_NOP - -#ifndef INCLUDED_SPE_MANAGER -# include "SpeManager.h" -#endif - -class SpeNop : public SpeTaskBase { -public: - /* constructor */ - SpeNop(void); - - /* variables */ - - /* functions */ - void read(void); - void exec(void); - void write(void); - SpeTaskBase* next(SpeManager *, SpeTaskBase *); -}; - -#endif
--- a/TaskManager/kernel/spe/SpeNop2Ready.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -#ifndef INCLUDED_SPE_NOP2READY -#define INCLUDED_SPE_NOP2READY - -#ifndef INCLUDED_SPE_MANAGER -# include "SpeManager.h" -#endif - -#ifndef INCLUDED_SPE_NOP -# include "SpeNop.h" -#endif - -class SpeNop2Ready : public SpeNop { -public: - /* constructor */ - SpeNop2Ready(DmaManager*); - - /* variables */ - DmaManager* connector; - - /* functions */ - void read(void); - void exec(void); - void write(void); - SpeTaskBase* next(SpeManager *, SpeTaskBase *); -}; - -#endif
--- a/TaskManager/kernel/spe/SpeTask.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -#ifndef INCLUDED_SPE_TASK -#define INCLUDED_SPE_TASK - -#ifndef INCLUDED_SPE_MANAGER -# include "SpeManager.h" -#endif - -class SpeTask : public SpeTaskBase { -public: - /* constructor */ - SpeTask(TaskListPtr, void*, void*, DmaManager*); - - /* variables */ - TaskListPtr list; - TaskPtr task; - void *readbuf; - void *writebuf; - - DmaManager* connector; - - // work area - // global variable 用とか - // 次の task に引き渡したり - // size : デフォルトで 4k - // ppuから教えてもらう? task に入れる - void (*func)(void *wbuf, void *rbuf); - - /* functions */ - SpeTaskBase* next(SpeManager *, SpeTaskBase *); - - // override - void read(void); - void exec(void); - void write(void); -}; - -#endif
--- a/TaskManager/kernel/spe/SpeTaskList.h Tue Feb 05 20:22:50 2008 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#ifndef INCLUDED_SPE_TASKLIST -#define INCLUDED_SPE_TASKLIST - -#ifndef INCLUDED_SPE_MANAGER -# include "SpeManager.h" -#endif - -class SpeTaskList : public SpeTaskBase { -public: - /* constructor */ - SpeTaskList(unsigned int addr, TaskListPtr list, DmaManager* c); - - /* variables */ - unsigned int params_addr; - TaskListPtr list; - DmaManager* connector; - - /* functions */ - SpeTaskBase* next(SpeManager *, SpeTaskBase *); - - /* override functions */ - void read(void); - void exec(void); - -#ifdef DEBUG - void write(void); -#endif - -}; - -//extern void get_task_list(); -//extern void print_task_list(); - -#endif