Mercurial > hg > Members > kono > Cerium
changeset 310:c59d8927c4d1
remove smanager
author | e065746@localhost.localdomain |
---|---|
date | Mon, 08 Jun 2009 20:31:29 +0900 |
parents | 8ec2f3e61ee1 |
children | b09784a9cb09 |
files | TaskManager/kernel/schedule/SchedTask.cc example/many_task/spe/QuickSort.cc example/renew_task/ppe/Renew1.cc example/renew_task/ppe/Renew2.cc example/renew_task/ppe/Renew3.cc example/renew_task/ppe/RenewStart.cc example/renew_task/spe/Renew1.cc example/renew_task/spe/Renew2.cc example/renew_task/spe/Renew3.cc example/renew_task/spe/Renew4.cc example/renew_task/spe/RenewStart.cc include/TaskManager/SchedTask.h |
diffstat | 12 files changed, 38 insertions(+), 119 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/SchedTask.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Mon Jun 08 20:31:29 2009 +0900 @@ -66,7 +66,7 @@ free(__list); } - delete smanager; + } /** @@ -95,7 +95,7 @@ __scheduler = sc; __cur_index = index; - smanager = new STaskManager(this); + __scheduler->mainMem_wait();
--- a/example/many_task/spe/QuickSort.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/many_task/spe/QuickSort.cc Mon Jun 08 20:31:29 2009 +0900 @@ -8,9 +8,9 @@ int QuickSort::run(void* rbuff, void* wbuff) { int begin = 0; - int end = smanager->get_param(0); - DataPtr r_data = (DataPtr)smanager->get_input(0); - DataPtr w_data = (DataPtr)smanager->get_output(0); + int end = get_param(0); + DataPtr r_data = (DataPtr)get_input(0); + DataPtr w_data = (DataPtr)get_output(0); //SpeProfile *prof = new SpeProfile; //prof->ProfStart();
--- a/example/renew_task/ppe/Renew1.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/ppe/Renew1.cc Mon Jun 08 20:31:29 2009 +0900 @@ -11,8 +11,8 @@ printf("[PPE] ** running Renew1\n"); printf("[PPE] Create Task : Renew2\n"); - TaskPtr nextTask = smanager->create_task(RENEW2); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW2); + wait_task(nextTask); printf("[PPE] ** finish Renew1\n"); printf("\n");
--- a/example/renew_task/ppe/Renew2.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/ppe/Renew2.cc Mon Jun 08 20:31:29 2009 +0900 @@ -11,8 +11,8 @@ printf("[PPE] ** running Renew2\n"); printf("[PPE] Create Task : Renew3\n"); - TaskPtr nextTask = smanager->create_task(RENEW3); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW3); + wait_task(nextTask); printf("[PPE] ** finish Renew2\n"); printf("\n");
--- a/example/renew_task/ppe/Renew3.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/ppe/Renew3.cc Mon Jun 08 20:31:29 2009 +0900 @@ -11,8 +11,8 @@ printf("[PPE] ** running Renew3\n"); printf("[PPE] Create Task : Renew4\n"); - TaskPtr nextTask = smanager->create_task(RENEW4); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW4); + wait_task(nextTask); printf("[PPE] ** finish Renew3\n"); printf("\n");
--- a/example/renew_task/ppe/RenewStart.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/ppe/RenewStart.cc Mon Jun 08 20:31:29 2009 +0900 @@ -11,8 +11,8 @@ printf("[PPE] ** running RenewStart\n"); printf("[PPE] Create Task : Renew1\n"); - TaskPtr nextTask = smanager->create_task(RENEW1); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW1); + wait_task(nextTask); printf("[PPE] ** finish RenewStart\n"); printf("\n");
--- a/example/renew_task/spe/Renew1.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/spe/Renew1.cc Mon Jun 08 20:31:29 2009 +0900 @@ -9,15 +9,15 @@ int Renew1::run(void *rbuf, void *wbuf) { - SpeProfile *profile = (SpeProfile*)smanager->global_get(0); + SpeProfile *profile = (SpeProfile*)global_get(0); profile->ProfStop(); profile->ProfPrint(); printf("[SPE] ** running Renew1\n"); printf("[SPE] Create Task : Renew2\n"); - TaskPtr nextTask = smanager->create_task(RENEW2); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW2); + wait_task(nextTask); printf("[SPE] ** finish Renew1\n\n");
--- a/example/renew_task/spe/Renew2.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/spe/Renew2.cc Mon Jun 08 20:31:29 2009 +0900 @@ -9,15 +9,15 @@ int Renew2::run(void *rbuf, void *wbuf) { - SpeProfile *profile = (SpeProfile*)smanager->global_get(0); + SpeProfile *profile = (SpeProfile*) global_get(0); profile->ProfStop(); profile->ProfPrint(); printf("[SPE] ** running Renew2\n"); printf("[SPE] Create Task : Renew3\n"); - TaskPtr nextTask = smanager->create_task(RENEW3); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW3); + wait_task(nextTask); printf("[SPE] ** finish Renew2\n\n");
--- a/example/renew_task/spe/Renew3.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/spe/Renew3.cc Mon Jun 08 20:31:29 2009 +0900 @@ -9,15 +9,15 @@ int Renew3::run(void *rbuf, void *wbuf) { - SpeProfile *profile = (SpeProfile*)smanager->global_get(0); + SpeProfile *profile = (SpeProfile*) global_get(0); profile->ProfStop(); profile->ProfPrint(); printf("[SPE] ** running Renew3\n"); printf("[SPE] Create Task : Renew4\n"); - TaskPtr nextTask = smanager->create_task(RENEW4); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW4); + wait_task(nextTask); printf("[SPE] ** finish Renew3\n"); printf("\n");
--- a/example/renew_task/spe/Renew4.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/spe/Renew4.cc Mon Jun 08 20:31:29 2009 +0900 @@ -9,7 +9,7 @@ int Renew4::run(void *rbuf, void *wbuf) { - SpeProfile *profile = (SpeProfile*)smanager->global_get(0); + SpeProfile *profile = (SpeProfile*) global_get(0); profile->ProfStop(); profile->ProfPrint(); @@ -17,7 +17,7 @@ printf("[SPE] ** finish Renew4\n"); - smanager->global_free(0); + global_free(0); return 0; }
--- a/example/renew_task/spe/RenewStart.cc Mon Jun 08 19:40:27 2009 +0900 +++ b/example/renew_task/spe/RenewStart.cc Mon Jun 08 20:31:29 2009 +0900 @@ -11,12 +11,12 @@ { printf("[SPE] ** running RenewStart\n"); - void *tmp = smanager->global_alloc(sizeof(SpeProfile), 0); + void *tmp = global_alloc(sizeof(SpeProfile), 0); SpeProfile *profile = new (tmp) SpeProfile; printf("[SPE] Create Task : Renew1\n"); - TaskPtr nextTask = smanager->create_task(RENEW1); - smanager->wait_task(nextTask); + TaskPtr nextTask = create_task(RENEW1); + wait_task(nextTask); printf("[SPE] ** finish RenewStart\n\n");
--- a/include/TaskManager/SchedTask.h Mon Jun 08 19:40:27 2009 +0900 +++ b/include/TaskManager/SchedTask.h Mon Jun 08 20:31:29 2009 +0900 @@ -132,99 +132,18 @@ void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask); void dma_wait(uint32 mask); -private: - class STaskManager { - public: - STaskManager(SchedTask *_t) { - outer = _t; - } - - BASE_NEW_DELETE(STaskManager); - - SchedTask *outer; - - int get_cpuid() { - return outer->get_cpuid(); - } - - void* get_input(int index) { - return outer->get_input(outer->__readbuf, index); - } - - void* get_output(int index) { - return outer->get_output(outer->__writebuf, index); - } - - uint32 get_inputAddr(int index) { - return outer->get_inputAddr(index); - } - - uint32 get_outputAddr(int index) { - return outer->get_outputAddr(index); - } - - uint32 get_inputSize(int index) { - return outer->get_inputSize(index); - } - - uint32 get_outputSize(int index) { - return outer->get_outputSize(index); - } - - int get_param(int index) { - return outer->get_param(index); - } - - TaskPtr create_task(int cmd) { - return outer->create_task(cmd); - } + + /*! + SPU用の get_input, get_output + */ - void wait_task(TaskPtr waitTask) { - outer->wait_task(waitTask); - } - - void* global_alloc(int id, int size) { - return outer->global_alloc(id, size); - } - - void* global_get(int id) { - return outer->global_get(id); - } - - void global_free(int id) { - outer->global_free(id); - } - - void mainMem_alloc(int id, int size) { - outer->mainMem_alloc(id, size); - } - - void mainMem_wait() { - outer->mainMem_wait(); - } - - void* mainMem_get(int id) { - return outer->mainMem_get(id); - } - - void *allocate(int size) { - return outer->allocate(size); - } - - void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask) { - outer->dma_load(buf, addr, size, mask); - } - - void dma_store(void *buf,uint32 addr, uint32 size, uint32 mask) { - outer->dma_store(buf, addr, size, mask); - } - - void dma_wait(uint32 mask) { - outer->dma_wait(mask); - } - }; - - STaskManager *smanager; + void* get_input(int index) { + return get_input(__readbuf, index); + } + + void* get_output(int index) { + return get_output(__writebuf, index); + } }; const int SCHED_TASK_NORMAL = 0;