Mercurial > hg > Members > kono > Cerium
changeset 88:504899860e66
*** empty log message ***
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Wed Feb 27 17:16:29 2008 +0900 @@ -51,7 +51,7 @@ task = &list->tasks[list->length++]; task->command = htask->command; -#ifndef _NO_DOUBLE_BUFFER +#ifdef _NO_DOUBLE_BUFFER // Fix me !!!!! // ださいというか動かないだろこれ。 // かっこいい class 判定がないものか。typeinfoだっけ?
--- a/TaskManager/Cell/spe/CellDmaManager.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Wed Feb 27 17:16:29 2008 +0900 @@ -1,19 +1,22 @@ #include <stdio.h> -#include <spu_mfcio.h> +#include <stdlib.h> +#include <malloc.h> #include "CellDmaManager.h" void -CellDmaManager::dma_load(void *buf, unsigned int addr, int size, int mask) +CellDmaManager::dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) { - if (buf == NULL || (void*)addr == NULL) return; + //if (buf == NULL || (void*)addr == NULL) return; + if (size == 0) return ; spu_mfcdma32(buf, addr, ROUND_UP_ALIGN(size, DEFAULT_ALIGNMENT), mask, MFC_GET_CMD); } void -CellDmaManager::dma_store(void *buf, unsigned int addr, int size, int mask) +CellDmaManager::dma_store(void *buf, uint32 addr, uint32 size, uint32 mask) { - if (buf == NULL || (void*)addr == NULL) return; + //if (buf == NULL || (void*)addr == NULL) return; + if (size == 0) return ; spu_mfcdma32(buf, addr, ROUND_UP_ALIGN(size, DEFAULT_ALIGNMENT), mask, MFC_PUT_CMD); } @@ -22,14 +25,14 @@ * mask で設定した DMA 転送の完了を待つ */ void -CellDmaManager::dma_wait(int mask) +CellDmaManager::dma_wait(uint32 mask) { spu_writech(MFC_WrTagMask, 1 << mask); spu_mfcstat(MFC_TAG_UPDATE_ALL); } void -CellDmaManager::mail_write(unsigned int data) +CellDmaManager::mail_write(uint32 data) { spu_writech(SPU_WrOutMbox, data); } @@ -39,3 +42,65 @@ { return spu_readch(SPU_RdInMbox); } + +void +CellDmaManager::dmaList_set(uint32 _address, uint32 _size) +{ + int *index = &buff_index[buff_flag]; + DmaListPtr queue = &dmaQueue[buff_flag][(*index)++]; + + queue->addr = _address; + queue->size = ROUND_UP_ALIGN(_size, DEFAULT_ALIGNMENT); +} + +void** +CellDmaManager::dmaList_load(uint32 mask) +{ + int index = buff_index[buff_flag]; + DmaListPtr queue = dmaQueue[buff_flag]; + mfc_list_element_t *mfc_list = mfcList[buff_flag]; + + void **buffList; + void *buff; + int bound; + int total_size = 0; + + mfc_list = (mfc_list_element_t *)malloc(sizeof(mfc_list_element_t)*index); + + for (int i = 0; i < index; i++) { + mfc_list[i].notify = 0; + mfc_list[i].reserved = 0; + mfc_list[i].size = queue[i].size; + mfc_list[i].eal = queue[i].addr; + total_size += queue[i].size; + } + + //---------------------------------------------------------------- + // list element が n 個ある場合の buff, buffList の構造 + // + // +---------------+---------------+--------+-----------------+ + // buff | queue[0].size | queue[1].size | ...... | queue[n-1].size | + // +---------------+---------------+--------+-----------------+ + // ^ ^ ^ ^ + // | | | | + // buffList[0] buffList[1] buffList[2] buffList[n-1] + //---------------------------------------------------------------- + + buff = memalign(DEFAULT_ALIGNMENT, total_size); + buffList = (void**)malloc(index); + + bound = (int)buff; + buffList[0] = (void*)bound; + for (int i = 1; i < index; i++) { + bound += queue[i-1].size; + buffList[i] = (void*)bound; + } + + mfc_getl(buff, 0, mfc_list, sizeof(mfc_list_element_t), mask, 0, 0); + dma_wait(mask); + + _buffList[buff_flag] = buffList; + _buff[buff_flag] = buff; + + return buffList; +}
--- a/TaskManager/Cell/spe/CellScheduler.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Cell/spe/CellScheduler.cc Wed Feb 27 17:16:29 2008 +0900 @@ -3,16 +3,20 @@ #include "CellDmaManager.h" #include "error.h" +// ユーザプログラムで定義 +// なんだけど、それは微妙じゃね? +extern void task_init(void); + void CellScheduler::init_impl(void) { connector = new CellDmaManager; for (int i = 0; i < 2; i++) { - //listBuf[i] = (TaskListPtr)memalign(DEFAULT_ALIGNMENT, - //sizeof(TaskListPtr)); listBuf[i] = (TaskListPtr)memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); readBuf[i] = memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); writeBuf[i] = memalign(DEFAULT_ALIGNMENT, DMA_MAX_SIZE); } + + task_init(); }
--- a/TaskManager/Cell/spe/SchedTask.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Cell/spe/SchedTask.cc Wed Feb 27 17:16:29 2008 +0900 @@ -5,24 +5,27 @@ #include "error.h" #include "TaskManager.h" -//extern int (*func_list[16])(void*, void*); +extern SchedTask::TaskObject task_list[16]; + +SchedTask* +CreateSchedTask(TaskListPtr taskList, void *readbuf, void *writebuf, + DmaManager* dma) +{ + TaskPtr task = &taskList->tasks[--taskList->length]; + + return task_list[task->command](taskList, task, readbuf, writebuf, dma); +} + SchedTask::SchedTask(TaskListPtr _list, TaskPtr _task, void *rbuf, void *wbuf, - DmaManager* cn) -{ - list = _list; - task = _task; - readbuf = rbuf; - writebuf = wbuf; - connector = cn; -} + DmaManager* cn) + : list(_list), task(_task), readbuf(rbuf), writebuf(wbuf), connector(cn) {} void SchedTask::read(void) { __debug("[SchedTask:%s]\n", __FUNCTION__); - //task = &list->tasks[--list->length]; connector->dma_load(readbuf, task->in_addr, task->in_size, DMA_READ); } @@ -40,7 +43,6 @@ __debug(" list->next = 0x%x\n", (unsigned int)list->next); __debug(" list->length = 0x%x\n", (unsigned int)list->length); - //task->in_size = func_list[task->command](readbuf, writebuf); task->in_size = run(readbuf, writebuf); connector->dma_store(writebuf, task->out_addr, task->in_size, DMA_WRITE); } @@ -71,25 +73,7 @@ m->get_curListBuf(), connector); } } else { - //return new SchedTask(list, m->get_curReadBuf(), - //m->get_curWriteBuf(), connector); - - // 本当は、ここで task->command に対応する、 - // SchedTask を継承する class を作ればいい。。。はず - return new SchedTask(list, &list->tasks[--list->length], - m->get_curReadBuf(), m->get_curWriteBuf(), - connector); + return CreateSchedTask(list, m->get_curReadBuf(), m->get_curWriteBuf(), + connector); } } - -extern SchedTask* (*task_list[16])(TaskListPtr, TaskPtr, void*, void*, - DmaManager*); - -SchedTask* -CreateSchedTask(TaskListPtr taskList, void *readbuf, void *writebuf, - DmaManager* dma) -{ - TaskPtr task = &taskList->tasks[--taskList->length]; - - return task_list[task->command](taskList, task, readbuf, writebuf, dma); -}
--- a/TaskManager/Cell/spe/SchedTaskList.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Cell/spe/SchedTaskList.cc Wed Feb 27 17:16:29 2008 +0900 @@ -32,17 +32,8 @@ if (list->length < 1) { return new SchedNop2Ready(connector); } else { - // 本当は、ここで task->command に対応する、 - // SchedTask を継承する class を作ればいい。。。はず -#if 0 - return new SchedTask(list, &list->tasks[--list->length], - m->get_curReadBuf(), - m->get_curWriteBuf(), - connector); -#else return CreateSchedTask(list, m->get_curReadBuf(), m->get_curWriteBuf(), connector); -#endif } }
--- a/TaskManager/Test/simple_render/spe/CreatePolygonPack.cpp Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/CreatePolygonPack.cpp Wed Feb 27 17:16:29 2008 +0900 @@ -5,6 +5,15 @@ #include "scene_graph_pack.h" #include "sys.h" + +void +CreatePolygonPack::read(void) +{ + printf("CreatePolgonPack\n"); + + SchedTask::read(); +} + //create_pp(SceneGraphPack *sgp, PolygonPack *pp) //create_pp(void *read, void *write) //CreatePolygonPack::run(SceneGraphPack *sgp, PolygonPack *pp)
--- a/TaskManager/Test/simple_render/spe/CreatePolygonPack.h Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Test/simple_render/spe/CreatePolygonPack.h Wed Feb 27 17:16:29 2008 +0900 @@ -10,7 +10,7 @@ CreatePolygonPack(TaskListPtr _tlist, TaskPtr _task, void* _rbuf, void* _wbuf, DmaManager* _con) :SchedTask(_tlist, _task, _rbuf, _wbuf, _con) {} - + void read(void); int run(void *readbuf, void *writebuf); private:
--- a/TaskManager/Test/simple_render/viewer.cpp Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/Test/simple_render/viewer.cpp Wed Feb 27 17:16:29 2008 +0900 @@ -218,8 +218,8 @@ SDL_PixelFormat *pixelFormat; Uint32 background; Polygon *polygon; -//SceneGraphPack *sgp; -//PolygonPack *pp; +SceneGraphPack *sgp; +PolygonPack *pp; DmaBuffer *sgp_buff; DmaBuffer *pp_buff; DmaBuffer *ssl_buff; @@ -231,10 +231,9 @@ HTaskPtr task; int fd; - SceneGraphPack *sgp; - PolygonPack *pp; - SPUSPANLIST *ssl; - + //SceneGraphPack *sgp; + //PolygonPack *pp; + //SPUSPANLIST *ssl; start_time = get_ticks(); this_time = 0; @@ -246,6 +245,7 @@ polygon->set_data("cube.xml"); polygon->viewer = this; +#if 0 // USE DOUBLE BUFFER sgp_buff = manager->allocate(sizeof(SceneGraphPack)); pp_buff = manager->allocate(sizeof(PolygonPack)); ssl_buff = manager->allocate(sizeof(SPUSPANLIST)); @@ -263,6 +263,11 @@ pp_buff->swap_buffer(); ssl_buff->swap_buffer(); } +#else + posix_memalign((void**)&sgp, 16, sizeof(SceneGraphPack)); + posix_memalign((void**)&pp, 16, sizeof(SceneGraphPack)); + create_sgp(polygon, sgp); +#endif pixels = new Uint32[width*height]; @@ -314,16 +319,27 @@ fd_create_sp = manager->open("CreateSP"); fd = manager->open("ViewerRunDraw"); +#if 0 // USE DOUBLE BUFFER task_update_sgp = manager->create_task(fd_update_sgp, sizeof(SceneGraphPack), sgp_buff, sgp_buff, NULL); task_create_pp = manager->create_task(fd_create_pp, sizeof(SceneGraphPack), sgp_buff, pp_buff, NULL); +#else + task_update_sgp + = manager->create_task(fd_update_sgp, sizeof(SceneGraphPack), + (uint32)sgp, (uint32)sgp, NULL); + task_create_pp + = manager->create_task(fd_create_pp, sizeof(SceneGraphPack), + (uint32)sgp, (uint32)pp, NULL); +#endif + +#if 0 task_create_sp = manager->create_task(fd_create_sp, sizeof(SceneGraphPack), pp_buff, ssl_buff, NULL); -#if 0 + task_draw_finish = manager->create(); for (int i = 0; i < draw_spe_num; i++) { task_spu_draw[i] @@ -357,9 +373,11 @@ HTaskPtr task; int fd; +#if 0 // USE DOUBLE BUFFER PolygonPack *pp; pp_buff->get_buffer(&pp); +#endif polygon->draw(pp); // test draw of PolygonPack SDL_BlitSurface(bitmap, NULL, screen, NULL);
--- a/TaskManager/kernel/ppe/BufferManager.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/ppe/BufferManager.cc Wed Feb 27 17:16:29 2008 +0900 @@ -28,8 +28,8 @@ } HTaskPtr -BufferManager::create_task(int cmd, int siz, DmaBuffer *in, DmaBuffer *out) -//BufferManager::create_task(int cmd, int siz, unsigned int in, unsigned int out) +//BufferManager::create_task(int cmd, int siz, DmaBuffer *in, DmaBuffer *out) +BufferManager::create_task(int cmd, int siz, unsigned int in, unsigned int out) { return htaskImpl->create(cmd, siz, in, out); }
--- a/TaskManager/kernel/ppe/DmaBuffer.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/ppe/DmaBuffer.cc Wed Feb 27 17:16:29 2008 +0900 @@ -3,6 +3,33 @@ #include "types.h" #include "DmaBuffer.h" +#define ALIGN_DOWN(v, align) ((v)&(-align)) +#define ALIGN_UP(v, align) ALIGN_DOWN((v)+((align)-1), align) + +void* +new_align(int alignment, int size) +{ + char *nonalign; + char *align; + + nonalign = new char[size + sizeof(void*) + alignment - 1]; + align = (char*)(ALIGN_UP((unsigned int)nonalign+sizeof(void*),alignment)); + *((void**)align - 1) = (void*)nonalign; + + return align; +} + +void +free_align(void *ptr) +{ + char *real; + + if (ptr != NULL) { + real = (char*)(*((void**)(ptr)-1)); + delete real; + } +} + DmaBuffer::DmaBuffer(int size) { buffer[0] = malloc(size); @@ -11,13 +38,18 @@ //posix_memalign(&buffer[0], DEFAULT_ALIGNMENT, size); //posix_memalign(&buffer[1], DEFAULT_ALIGNMENT, size); + //buffer[0] = new_align(DEFAULT_ALIGNMENT, size); + //buffer[1] = new_align(DEFAULT_ALIGNMENT, size); + flag = 0; } DmaBuffer::~DmaBuffer(void) { - free(buffer[0]); - free(buffer[1]); + //free(buffer[0]); + //free(buffer[1]); + free_align(buffer[0]); + free_align(buffer[1]); } void
--- a/TaskManager/kernel/ppe/HTaskInfo.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/ppe/HTaskInfo.cc Wed Feb 27 17:16:29 2008 +0900 @@ -45,8 +45,8 @@ } HTaskPtr -HTaskInfo::create(int cmd, int size, DmaBuffer *in_addr, DmaBuffer *out_addr) -//HTaskInfo::create(int cmd, int size, unsigned int in_addr, unsigned int out_addr) +//HTaskInfo::create(int cmd, int size, DmaBuffer *in_addr, DmaBuffer *out_addr) +HTaskInfo::create(int cmd, int size, unsigned int in_addr, unsigned int out_addr) { HTaskPtr q;
--- a/TaskManager/kernel/ppe/TaskManager.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskManager.cc Wed Feb 27 17:16:29 2008 +0900 @@ -49,10 +49,10 @@ */ HTaskPtr -TaskManager::create_task(int cmd, int size, DmaBuffer *in, - DmaBuffer *out, void (*func)(void)) -//TaskManager::create_task(int cmd, int size, unsigned int in, -// unsigned int out, void (*func)(void)) +//TaskManager::create_task(int cmd, int size, DmaBuffer *in, +// DmaBuffer *out, void (*func)(void)) +TaskManager::create_task(int cmd, int size, unsigned int in, + unsigned int out, void (*func)(void)) { return m_impl->create_task(cmd, size, in, out, func); }
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Wed Feb 27 17:16:29 2008 +0900 @@ -29,10 +29,10 @@ } HTaskPtr -TaskManagerImpl::create_task(int cmd, int size, DmaBuffer *in_addr, - DmaBuffer *out_addr, void (*func)(void)) -//TaskManagerImpl::create_task(int cmd, int size, unsigned int in_addr, -// unsigned int out_addr, void (*func)(void)) +//TaskManagerImpl::create_task(int cmd, int size, DmaBuffer *in_addr, +// DmaBuffer *out_addr, void (*func)(void)) +TaskManagerImpl::create_task(int cmd, int size, unsigned int in_addr, + unsigned int out_addr, void (*func)(void)) { HTaskPtr new_task; @@ -107,7 +107,7 @@ task = &list->tasks[list->length++]; task->command = htask->command; -#ifndef _NO_DOUBLE_BUFFER +#if 0 // Fix me !!!!! // ださい // かっこいい class 判定がないものか。typeinfoだっけ?
--- a/TaskManager/kernel/schedule/FifoDmaManager.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/schedule/FifoDmaManager.cc Wed Feb 27 17:16:29 2008 +0900 @@ -3,7 +3,7 @@ #include "FifoDmaManager.h" void -FifoDmaManager::dma_load(void *buf, unsigned int addr, int size, int mask) +FifoDmaManager::dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) { //if ((void*)addr == NULL) return; if (size == 0) return; @@ -11,7 +11,7 @@ } void -FifoDmaManager::dma_store(void *buf, unsigned int addr, int size, int mask) +FifoDmaManager::dma_store(void *buf, uint32 addr, uint32 size, uint32 mask) { //if ((void*)addr == NULL) return; if (size == 0) return; @@ -22,14 +22,14 @@ * mask で設定した DMA 転送の完了を待つ */ void -FifoDmaManager::dma_wait(int mask) +FifoDmaManager::dma_wait(uint32 mask) { //spu_writech(MFC_WrTagMask, 1 << mask); //spu_mfcstat(MFC_TAG_UPDATE_ALL); } void -FifoDmaManager::mail_write(unsigned int data) +FifoDmaManager::mail_write(uint32 data) { //spu_writech(SPU_WrOutMbox, data); @@ -42,7 +42,7 @@ FifoDmaManager::mail_read(void) { MailQueuePtr q; - unsigned int ret; + uint32 ret; q = mail_recvQueue;
--- a/TaskManager/kernel/schedule/SchedTask.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Wed Feb 27 17:16:29 2008 +0900 @@ -9,7 +9,7 @@ SymTable *TaskManager::symtb; SchedTask::SchedTask(TaskListPtr _list, TaskPtr _task, void *rbuf, void *wbuf, - DmaManager* cn) + DmaManager* cn) { list = _list; task = _task; @@ -23,7 +23,6 @@ { __debug("[SchedTask:%s]\n", __FUNCTION__); - //task = &list->tasks[--list->length]; connector->dma_load(readbuf, task->in_addr, task->in_size, DMA_READ); } @@ -76,7 +75,7 @@ return new SchedNop2Ready(connector); } else { return new SchedTaskList((unsigned int)list->next, - m->get_curListBuf(), connector); + m->get_curListBuf(), connector); } } else { //return new SchedTask(list, m->get_curReadBuf(),
--- a/TaskManager/kernel/schedule/SchedTaskList.cc Wed Feb 27 11:14:20 2008 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskList.cc Wed Feb 27 17:16:29 2008 +0900 @@ -38,3 +38,4 @@ connector); } } +
--- a/include/TaskManager/BufferManager.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/BufferManager.h Wed Feb 27 17:16:29 2008 +0900 @@ -45,8 +45,8 @@ virtual void init(void); TaskQueuePtr create_taskQueue(HTaskPtr); - HTaskPtr create_task(int cmd, int siz, DmaBuffer *in, DmaBuffer *out); - //HTaskPtr create_task(int cmd, int siz, unsigned int in, unsigned int out); + //HTaskPtr create_task(int cmd, int siz, DmaBuffer *in, DmaBuffer *out); + HTaskPtr create_task(int cmd, int siz, unsigned int in, unsigned int out); void free_taskQueue(TaskQueuePtr); void free_task(HTaskPtr);
--- a/include/TaskManager/CellDmaManager.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/CellDmaManager.h Wed Feb 27 17:16:29 2008 +0900 @@ -5,14 +5,33 @@ # include "DmaManager.h" #endif +#include <spu_mfcio.h> + class CellDmaManager : public DmaManager { public: + typedef struct dma_list { + uint32 addr; + uint32 size; + } DmaList, *DmaListPtr; + + /* variables */ + void **_buffList[2]; + void *_buff[2]; + int buff_index[2]; + int buff_flag; + DmaList dmaQueue[2][64]; + mfc_list_element_t *mfcList[2]; + /* 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); + void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask); + void dma_store(void *buf, uint32 addr, uint32 size, uint32 mask); + void dma_wait(uint32 mask) ; + + void mail_write(uint32 data); + uint32 mail_read(void); + + void dmaList_set(uint32 address, uint32 size); + void** dmaList_load(uint32 mask); }; #endif
--- a/include/TaskManager/DmaManager.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/DmaManager.h Wed Feb 27 17:16:29 2008 +0900 @@ -14,12 +14,18 @@ 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; + // API for DMA transfer + virtual void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask)=0; + virtual void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask)=0; + virtual void dma_wait(uint32 mask) = 0; - virtual void mail_write(unsigned int data) = 0; - virtual unsigned int mail_read(void) = 0; + // API for SPU inbound/outbound mailbox + virtual void mail_write(uint32 data) = 0; + virtual uint32 mail_read(void) = 0; + + // API for MFC list DMA transfer + virtual void dmaList_set(uint32 address, uint32 size) {} + virtual void** dmaList_load(uint32 mask) { return (void**)0; } }; #endif
--- a/include/TaskManager/FifoDmaManager.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/FifoDmaManager.h Wed Feb 27 17:16:29 2008 +0900 @@ -17,12 +17,12 @@ 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 dma_load(void *buf, uint32 addr, uint32 size, uint32 mask); + void dma_store(void *buf, uint32 addr, uint32 size, uint32 mask); + void dma_wait(uint32 mask) ; - void mail_write(unsigned int data); - unsigned int mail_read(void); + void mail_write(uint32 data); + uint32 mail_read(void); }; #endif
--- a/include/TaskManager/HTaskInfo.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/HTaskInfo.h Wed Feb 27 17:16:29 2008 +0900 @@ -18,10 +18,10 @@ struct htask { int command; int in_size; - //unsigned int in_addr; - //unsigned int out_addr; - DmaBuffer *in_addr; - DmaBuffer *out_addr; + unsigned int in_addr; + unsigned int out_addr; + //DmaBuffer *in_addr; + //DmaBuffer *out_addr; TaskQueuePtr wait_me; // List of task waiting for me TaskQueuePtr wait_i; // List of task for which I am waiting void (*post_func)(void); @@ -42,8 +42,8 @@ /* functions */ int init(int num); - HTaskPtr create(int cmd,int size,DmaBuffer *in_addr, DmaBuffer *out_addr); - //HTaskPtr create(int cmd,int size, unsigned int in_addr, unsigned int out_addr); + //HTaskPtr create(int cmd,int size,DmaBuffer *in_addr, DmaBuffer *out_addr); + HTaskPtr create(int cmd,int size, unsigned int in_addr, unsigned int out_addr); void free(HTaskPtr q); private:
--- a/include/TaskManager/SchedTask.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/SchedTask.h Wed Feb 27 17:16:29 2008 +0900 @@ -11,6 +11,9 @@ class SchedTask : public SchedTaskBase { public: + typedef SchedTask* (*TaskObject)(TaskListPtr, TaskPtr, void*, void*, + DmaManager*); + /* constructor */ SchedTask(TaskListPtr, TaskPtr, void*, void*, DmaManager*);
--- a/include/TaskManager/TaskManager.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/TaskManager.h Wed Feb 27 17:16:29 2008 +0900 @@ -21,10 +21,10 @@ /* functions */ void init(void); void finish(void); - HTaskPtr create_task(int cmd, int siz, DmaBuffer *in_addr, - DmaBuffer *out_addr, void (*func)(void)); - //HTaskPtr create_task(int cmd, int siz, unsigned int in_addr, - //unsigned int out_addr, void (*func)(void)); + //HTaskPtr create_task(int cmd, int siz, DmaBuffer *in_addr, + //DmaBuffer *out_addr, void (*func)(void)); + HTaskPtr create_task(int cmd, int siz, unsigned int in_addr, + unsigned int out_addr, void (*func)(void)); //void set_task_depend(HTaskPtr master, HTaskPtr slave); //void spawn_task(HTaskPtr); void run(void);
--- a/include/TaskManager/TaskManagerImpl.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/TaskManagerImpl.h Wed Feb 27 17:16:29 2008 +0900 @@ -31,10 +31,10 @@ void run(void); virtual MailQueuePtr mail_check(MailQueuePtr mail_list); - HTaskPtr create_task(int cmd, int siz, DmaBuffer *in_addr, - DmaBuffer *out_addr, void (*func)(void)); - //HTaskPtr create_task(int cmd, int siz, unsigned int in_addr, - //unsigned int out_addr, void (*func)(void)); + //HTaskPtr create_task(int cmd, int siz, DmaBuffer *in_addr, + //DmaBuffer *out_addr, void (*func)(void)); + HTaskPtr create_task(int cmd, int siz, unsigned int in_addr, + unsigned int out_addr, void (*func)(void)); void set_task_depend(HTaskPtr master, HTaskPtr slave); virtual TaskListPtr set_task(void); virtual void spawn_task(HTaskPtr);
--- a/include/TaskManager/types.h Wed Feb 27 11:14:20 2008 +0900 +++ b/include/TaskManager/types.h Wed Feb 27 17:16:29 2008 +0900 @@ -1,7 +1,7 @@ #ifndef INCLUDED_TYPES #define INCLUDED_TYPES -typedef unsigned int uint32; +typedef unsigned int uint32; typedef unsigned long long uint64; #define SPE_ALIGNMENT 16 @@ -14,6 +14,9 @@ #define DMA_MAX_SIZE 16384 +#define round_up16(value) ROUND_UP_ALIGN(value, 16) +#define round_up128(value) ROUND_UP_ALIGN(value, 128) + // ここも typedef しとくか? enum { MY_SPE_COMMAND_EXIT,