Some reverting

This commit is contained in:
Farseer
2018-01-30 21:48:58 +02:00
committed by Zangetsu38
parent d2fc690ad2
commit 51278f108c
3 changed files with 26 additions and 40 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ void spu_recompiler_base::enter(SPUThread& spu)
// Search if cached data matches // Search if cached data matches
auto func_ptr = spu.compiled_cache[spu.pc / 4]; auto func_ptr = spu.compiled_cache[spu.pc / 4];
// func.contents is there only as a temporary test, to see if SPU code not getting invalidated is the reason for the crashes // Dirty bit check commented out until another code invalidation is found - SYNC, SYNCC, DSYNC and DMAs aren't covering everything
if (func_ptr && func_ptr->dirty_bit) if (func_ptr/* && func_ptr->dirty_bit*/)
{ {
auto & func = *func_ptr; auto & func = *func_ptr;
func.dirty_bit = false; func.dirty_bit = false;
+24 -37
View File
@@ -688,31 +688,33 @@ void SPUThread::process_mfc_cmd()
bool result = false; bool result = false;
// Check for fast exit in the beginning as well // Check for fast exit in the beginning as well
vm::writer_lock lock(vm::try_to_lock); if (raddr == ch_mfc_cmd.eal && rtime == vm::reservation_acquire(raddr, 128) && rdata == data)
{
if (lock.locked || memcmp(rdata.data(), data.data(), rdata.size() * sizeof(rdata[0])) == 0) { // TODO: vm::check_addr
if (raddr == ch_mfc_cmd.eal && rtime == vm::reservation_acquire(raddr, 128)) if (s_use_rtm && utils::transaction_enter())
{ {
// TODO: vm::check_addr if (!vm::reader_lock{ vm::try_to_lock })
if (s_use_rtm && utils::transaction_enter())
{ {
if (!lock.locked && !vm::reader_lock{ vm::try_to_lock }) _xabort(0);
{
_xabort(0);
}
if (rtime == vm::reservation_acquire(raddr, 128) && rdata == data)
{
data = to_write;
result = true;
vm::reservation_update(raddr, 128);
vm::notify(raddr, 128);
}
_xend();
} }
else if (lock.locked)
if (rtime == vm::reservation_acquire(raddr, 128) && rdata == data)
{
data = to_write;
result = true;
vm::reservation_update(raddr, 128);
vm::notify(raddr, 128);
}
_xend();
}
else
{
// TODO maybe timeout and check if the lock is still needed in long waits (If rtime changes, no use)
vm::writer_lock lock;
if (rtime == vm::reservation_acquire(raddr, 128))
{ {
data = to_write; data = to_write;
vm::reservation_update(raddr, 128); vm::reservation_update(raddr, 128);
@@ -721,21 +723,6 @@ void SPUThread::process_mfc_cmd()
result = true; result = true;
vm::notify(raddr, 128); vm::notify(raddr, 128);
} }
else
{
// TODO maybe timeout and check if the lock is still needed in long waits (If rtime changes, no use)
vm::writer_lock lock(0);
if (rtime == vm::reservation_acquire(raddr, 128))
{
data = to_write;
vm::reservation_update(raddr, 128);
lock.unlock();
result = true;
vm::notify(raddr, 128);
}
}
} }
} }
-1
View File
@@ -42,7 +42,6 @@ namespace vm
{ {
named_thread* owner; named_thread* owner;
u32 addr; u32 addr;
bool inserted = false;
u64 stamp; u64 stamp;
const void* data; const void* data;
static const u32 size = 128; // Always 128 currently static const u32 size = 128; // Always 128 currently