Mercurial > hg > Game > Cerium
changeset 249:eeb859bc39f1 draft
no move
author | e065746@localhost.localdomain |
---|---|
date | Tue, 02 Jun 2009 21:38:30 +0900 |
parents | e9735a64cd90 |
children | bf337e2b9be0 |
files | TaskManager/Cell/spe/CellDmaManager.cc TaskManager/Cell/spe/SchedMail.cc include/TaskManager/CellDmaManager.h include/TaskManager/SchedExit.h |
diffstat | 4 files changed, 28 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/spe/CellDmaManager.cc Sun May 31 20:08:42 2009 +0900 +++ b/TaskManager/Cell/spe/CellDmaManager.cc Tue Jun 02 21:38:30 2009 +0900 @@ -2,6 +2,9 @@ #include <stdlib.h> #include "CellDmaManager.h" +unsigned int CellDmaManager::wait_time, CellDmaManager::busy_time; +unsigned long long CellDmaManager::global_busy_time, CellDmaManager::global_wait_time; + /** * DMA Load * @@ -37,23 +40,31 @@ * * @param[in] mask Tag for Wait DMA process */ -void + +static void CellDmaManager::start_dmawait_profile() { wait_time = spu_readch(SPU_RdDec); + // global 変数にする global_busy_time += busy_time - wait_time; spu_writech(SPU_WrDec, 0xffffffff); } -void +static void CellDmaManager::end_dmawait_profile() { wait_time = spu_readch(SPU_RdDec); + // global 変数にする global_wait_time += 0xffffffff - wait_time; busy_time = wait_time; } void +CellDmaManager::print_wait() +{ +} + +void CellDmaManager::dma_wait(uint32 mask) { #ifdef SPU_PROFILE
--- a/TaskManager/Cell/spe/SchedMail.cc Sun May 31 20:08:42 2009 +0900 +++ b/TaskManager/Cell/spe/SchedMail.cc Tue Jun 02 21:38:30 2009 +0900 @@ -13,12 +13,17 @@ { delete p; + // dma wait + scheduler->start_dmawait_profile(); params_addr = scheduler->mail_read(); + scheduler->end_dmawait_profile(); __debug("[SchedMail:%s]\n", __FUNCTION__); - if ((int)params_addr == MY_SPE_COMMAND_EXIT) { - return new SchedExit(); + if ((int)params_addr == MY_SPE_COMMAND_EXIT) { + // ppu 側から spu の実行状況表示用 Task を投げる + // counter は global + return new SchedExit(m); } else { return new SchedTaskList(params_addr, m); }
--- a/include/TaskManager/CellDmaManager.h Sun May 31 20:08:42 2009 +0900 +++ b/include/TaskManager/CellDmaManager.h Tue Jun 02 21:38:30 2009 +0900 @@ -13,6 +13,9 @@ #define SPU_PROFILE 1 +extern unsigned int CellDmaManager::wait_time, CellDmaManager::busy_time; +extern unsigned long long CellDmaManager::global_busy_time, CellDmaManager::global_wait_time; + class CellDmaManager : public DmaManager { public: BASE_NEW_DELETE(CellDmaManager); @@ -23,8 +26,7 @@ } DmaList, *DmaListPtr; /* variables */ - unsigned int wait_time, busy_time; - unsigned long long global_busy_time, global_wait_time; + /* functions */ void dma_load(void *buf, uint32 addr, uint32 size, uint32 mask);
--- a/include/TaskManager/SchedExit.h Sun May 31 20:08:42 2009 +0900 +++ b/include/TaskManager/SchedExit.h Tue Jun 02 21:38:30 2009 +0900 @@ -16,6 +16,10 @@ class SchedExit : public SchedTaskBase { public: BASE_NEW_DELETE(SchedExit); + + SchedExit(Scheduler *m) { + scheduler = m; + } SchedTaskBase* next(Scheduler *, SchedTaskBase *); };