Mercurial > hg > Members > kono > Cerium
changeset 1009:c67379f9d411
not yet....
author | yutaka@localhost.localdomain |
---|---|
date | Thu, 28 Oct 2010 13:00:51 +0900 |
parents | b48fffbba5fc |
children | 44b2c4cb539d |
files | TaskManager/Cell/spe/CellDmaManager.cc TaskManager/Cell/spe/CellDmaManager.h TaskManager/Cell/spe/MailQueue.h TaskManager/kernel/schedule/SchedNop2Ready.cc TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTaskArrayNop.cc TaskManager/kernel/schedule/Scheduler.cc |
diffstat | 7 files changed, 29 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/spe/CellDmaManager.cc Thu Oct 28 08:43:38 2010 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Thu Oct 28 13:00:51 2010 +0900 @@ -6,6 +6,8 @@ unsigned long long alloc_flag = 0; +QueueInfo<MailQueue> *MailPool = new QueueInfo<MailQueue>() ; + /** * DMA Load * @@ -88,21 +90,24 @@ void CellDmaManager::mail_write_queue(memaddr data) { (this->*start_dmawait_profile)(); - if (0 == spu_readchcnt(SPU_WrOutMbox)) { - if (mail_queue.empty()) { + if (0 != spu_readchcnt(SPU_WrOutMbox)) { + if (mail_queue->empty()) { spu_write_out_mbox((uint32)data); } else { - MailQueuePtr mail = mail_queue.getFirst(); + MailQueuePtr mail = mail_queue->poll(); + if (mail == NULL) { + printf("あっるえぇー、おっかっしぃぞぉー\n"); + } spu_write_out_mbox((uint32)mail->data); - mail_queue.free_(mail); - mail = mail_queue.create(); + mail_queue->free_(mail); + mail = mail_queue->create(); mail->data = data; - mail_queue.addLast(mail); + mail_queue->addLast(mail); } } else { - MailQueuePtr mail = mail_queue.create(); + MailQueuePtr mail = mail_queue->create(); mail->data = data; - mail_queue.addLast(mail); + mail_queue->addLast(mail); } (this->*end_dmawait_profile)(&global_mail_time); } @@ -113,13 +118,14 @@ (this->*start_dmawait_profile)(); - while (!mail_queue.empty()) { - MailQueuePtr mail = mail_queue.getFirst(); + while (!mail_queue->empty()) { + MailQueuePtr mail = mail_queue->poll(); spu_write_out_mbox((uint32)mail->data); - mail_queue.free_(mail); + mail_queue->free_(mail); } spu_write_out_mbox((uint32)data); + //mail_queue.freePool(); (this->*end_dmawait_profile)(&global_mail_time); } @@ -152,6 +158,9 @@ CellDmaManager::CellDmaManager() { + + mail_queue = new QueueInfo<MailQueue>(MailPool); + stop_profile(); } void
--- a/TaskManager/Cell/spe/CellDmaManager.h Thu Oct 28 08:43:38 2010 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.h Thu Oct 28 13:00:51 2010 +0900 @@ -23,7 +23,7 @@ uint32 size; } __attribute__ ((aligned (DEFAULT_ALIGNMENT))) DmaList, *DmaListPtr; - QueueInfo<MailQueue> mail_queue; + QueueInfo<MailQueue> *mail_queue; CellDmaManager() ;
--- a/TaskManager/Cell/spe/MailQueue.h Thu Oct 28 08:43:38 2010 +0900 +++ b/TaskManager/Cell/spe/MailQueue.h Thu Oct 28 13:00:51 2010 +0900 @@ -8,7 +8,7 @@ MailQueue *prev; // 4 byte MailQueue *waiter; // 4 byte - void init() { data = 0; waiter=this; } + void init() { data = 0; } void initOnce() {} void freeOnce() {}
--- a/TaskManager/kernel/schedule/SchedNop2Ready.cc Thu Oct 28 08:43:38 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedNop2Ready.cc Thu Oct 28 13:00:51 2010 +0900 @@ -21,7 +21,7 @@ { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); -#if MAIL_QUEUE +#ifdef MAIL_QUEUE scheduler->mail_write_finish_list((memaddr)MY_SPE_STATUS_READY); #else scheduler->mail_write((memaddr)MY_SPE_STATUS_READY);
--- a/TaskManager/kernel/schedule/SchedTask.cc Thu Oct 28 08:43:38 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Thu Oct 28 13:00:51 2010 +0900 @@ -110,13 +110,14 @@ if (!(cur_index < list->length) ) scheduler->mail_write(waiter); -#elseif MAIL_QUEUE +#else +#ifdef MAIL_QUEUE scheduler->mail_write_queue(waiter); - #else scheduler->mail_write(waiter); #endif +#endif } SchedTaskBase*
--- a/TaskManager/kernel/schedule/SchedTaskArrayNop.cc Thu Oct 28 08:43:38 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArrayNop.cc Thu Oct 28 13:00:51 2010 +0900 @@ -54,7 +54,8 @@ void SchedTaskArrayNop::write() { - savedTask ->write(); + savedTask->write(); + free(atask); delete savedTask; savedTask = 0;
--- a/TaskManager/kernel/schedule/Scheduler.cc Thu Oct 28 08:43:38 2010 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Thu Oct 28 13:00:51 2010 +0900 @@ -164,7 +164,7 @@ void Scheduler::mail_write_finish_list(memaddr data) { - connector->mail_write(data); + connector->mail_write_finish_list(data); } memaddr