Mercurial > hg > Members > kono > Cerium
changeset 871:ab3cd3aeacff
fix get segment dma tag zero problem
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 04 Jul 2010 16:56:04 +0900 |
parents | 79b2d56aa27a |
children | e49c1b29c43d |
files | TaskManager/Cell/spe/CellDmaManager.cc TaskManager/Cell/spe/CellScheduler.cc TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTaskArray.cc TaskManager/kernel/schedule/Scheduler.cc example/task_queue/testQueueInfo.cc |
diffstat | 6 files changed, 23 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/spe/CellDmaManager.cc Tue Jun 29 04:23:52 2010 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Sun Jul 04 16:56:04 2010 +0900 @@ -38,6 +38,7 @@ mfc_write_tag_mask(1 << mask); mfc_write_tag_update_all(); mfc_read_tag_status(); + __asm__ __volatile__(" sync"); (this->*end_dmawait_profile)(&global_wait_time); } @@ -45,10 +46,12 @@ { (this->*start_dmawait_profile)(); spu_write_out_mbox((uint32)data); +#if 0 if (ABIBIT>32) { unsigned long data0 = (unsigned long)data; - spu_write_out_mbox((uint32)(data0>>4)); + spu_write_out_mbox((uint32)(data0>>32)); } +#endif (this->*end_dmawait_profile)(&global_mail_time); } @@ -56,9 +59,11 @@ { (this->*start_dmawait_profile)(); memaddr data = (memaddr)spu_read_in_mbox(); +#if 0 if (ABIBIT>32) { - data += (spu_read_in_mbox()<<4); + data += (spu_read_in_mbox()<<32); } +#endif (this->*end_dmawait_profile)(&global_mail_time); return data; }
--- a/TaskManager/Cell/spe/CellScheduler.cc Tue Jun 29 04:23:52 2010 +0900 +++ b/TaskManager/Cell/spe/CellScheduler.cc Sun Jul 04 16:56:04 2010 +0900 @@ -60,14 +60,14 @@ */ -#define TEX_LOAD1 0 +// #define TEX_LOAD1 0 // #define TEX_LOAD2 1 uint32 CellScheduler::get_tag() { static int count = 0; - return TEX_LOAD1+(count++ % 2); + return (count++ % 8)+16; }
--- a/TaskManager/kernel/schedule/SchedTask.cc Tue Jun 29 04:23:52 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Sun Jul 04 16:56:04 2010 +0900 @@ -80,11 +80,11 @@ { __debug("[SchedTask:%s]\n", __FUNCTION__); + task_list[task->command].wait(scheduler,task->command); if (task->w_size > 0) { writebuf = manager->allocate(task->w_size); } scheduler->dma_wait(DMA_READ); - task_list[task->command].wait(scheduler,task->command); task_list[task->command].run(this, readbuf, writebuf); free(readbuf);
--- a/TaskManager/kernel/schedule/SchedTaskArray.cc Tue Jun 29 04:23:52 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArray.cc Sun Jul 04 16:56:04 2010 +0900 @@ -69,6 +69,7 @@ } } + /** * Task data / code read */ @@ -103,8 +104,10 @@ void SchedTaskArray::exec() { - + task_list[atask->command].wait(scheduler,atask->command); + TaskObjectRun run = task_list[atask->command].run; if (atask->outData_count > 0) { + // allocate write buffer outListData.length = atask->outData_count; outListData.size = atask->outData_total_size(); outListData.element = atask->outData(0); @@ -113,10 +116,8 @@ writebuf = manager->allocate(outListData.size); } - scheduler->dma_wait(DMA_READ); - task_list[atask->command].wait(scheduler,atask->command); - task_list[atask->command].run(this, readbuf, writebuf); + (*run)(this, readbuf, writebuf); free(readbuf); // 書き込む領域がなければ無視
--- a/TaskManager/kernel/schedule/Scheduler.cc Tue Jun 29 04:23:52 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Sun Jul 04 16:56:04 2010 +0900 @@ -109,7 +109,6 @@ return buff_taskList[buffFlag_taskList]; } - void Scheduler::dma_load(void *buf, memaddr addr, uint32 size, uint32 mask) { @@ -154,6 +153,7 @@ } + /* ここから下は、memory 以下にあるべき */ @@ -214,6 +214,12 @@ m->code_segment_pool, task_list[task_id].end-task_list[task_id].location); task_list[task_id].segment = s; + // calcurate call address + TaskObjectRun run = + (TaskObjectRun)( + (char*)task_list[task_id].segment->data + + task_list[task_id].entry_offset); + task_list[task_id].run = run; #if 0 m->printf("loadng task id %d at 0x%x entry 0x%x\n",task_id, (unsigned int)(task_list[task_id].segment->data ), @@ -240,15 +246,9 @@ #endif // wait for code segment load m->wait_segment(task_list[task_id].segment); - // calcurate call address - TaskObjectRun run = - (TaskObjectRun)( - (char*)task_list[task_id].segment->data + - task_list[task_id].entry_offset); - task_list[task_id].run = run; #if 0 m->printf("wait load task id %d done. creator = 0x%x entry_offset = 0x%x\n",task_id, - (unsigned int)run, + (unsigned int)(task_list[task_id].run), task_list[task_id].entry_offset); #endif }
--- a/example/task_queue/testQueueInfo.cc Tue Jun 29 04:23:52 2010 +0900 +++ b/example/task_queue/testQueueInfo.cc Sun Jul 04 16:56:04 2010 +0900 @@ -6,7 +6,6 @@ #include "Func.h" -// static QueueInfo<TaskList, TaskList>::queuePool; static QueueInfo<TaskList> *queuePool = new QueueInfo<TaskList>() ; void