RawSPU: implement Prxy_TagStatus_offs

Rollback to immediate MFC transfers
This commit is contained in:
Nekotekina 2017-08-31 22:03:47 +03:00
parent cfb858a51c
commit 3a08dd7dde
3 changed files with 16 additions and 14 deletions

View file

@ -77,6 +77,12 @@ bool RawSPUThread::read_reg(const u32 addr, u32& value)
value = status;
return true;
}
case Prxy_TagStatus_offs:
{
value = mfc_proxy.size() ? 0 : +mfc_prxy_mask;
return true;
}
}
LOG_ERROR(SPU, "RawSPUThread[%d]: Read32(0x%x): unknown/illegal offset (0x%x)", index, addr, offset);
@ -130,23 +136,15 @@ bool RawSPUThread::write_reg(const u32 addr, const u32 value)
case MFC_Class_CMD_offs:
{
g_tls_mfc[index].cmd = MFC(value & 0xff);
if (mfc_proxy.try_push(g_tls_mfc[index]))
{
auto mfc = fxm::check_unlocked<mfc_thread>();
do_dma_transfer(g_tls_mfc[index]);
g_tls_mfc[index] = {};
g_tls_mfc[index].cmd = MFC(MFC_PPU_DMA_CMD_ENQUEUE_SUCCESSFUL);
if (test(mfc->state, cpu_flag::stop) && mfc->state.test_and_reset(cpu_flag::stop))
{
mfc->notify();
}
g_tls_mfc[index] = {};
g_tls_mfc[index].cmd = MFC(MFC_PPU_DMA_CMD_ENQUEUE_SUCCESSFUL);
}
else
if (value & MFC_START_MASK)
{
g_tls_mfc[index] = {};
g_tls_mfc[index].cmd = MFC(MFC_PPU_DMA_QUEUE_FULL);
try_start();
}
return true;
}
@ -172,6 +170,7 @@ bool RawSPUThread::write_reg(const u32 addr, const u32 value)
case Prxy_QueryMask_offs:
{
mfc_prxy_mask = value;
return true;
}

View file

@ -274,6 +274,7 @@ void SPUThread::cpu_init()
srr0 = 0;
ch_tag_upd = 0;
ch_tag_mask = 0;
mfc_prxy_mask = 0;
ch_tag_stat.data.store({});
ch_stall_mask = 0;
ch_stall_stat.data.store({});

View file

@ -550,6 +550,8 @@ public:
spu_channel_4_t ch_in_mbox;
atomic_t<u32> mfc_prxy_mask;
spu_channel_t ch_out_mbox;
spu_channel_t ch_out_intr_mbox;