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;
+3 -16
View File
@@ -688,15 +688,12 @@ 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) {
if (raddr == ch_mfc_cmd.eal && rtime == vm::reservation_acquire(raddr, 128))
{ {
// TODO: vm::check_addr // TODO: vm::check_addr
if (s_use_rtm && utils::transaction_enter()) if (s_use_rtm && utils::transaction_enter())
{ {
if (!lock.locked && !vm::reader_lock{ vm::try_to_lock }) if (!vm::reader_lock{ vm::try_to_lock })
{ {
_xabort(0); _xabort(0);
} }
@@ -712,19 +709,10 @@ void SPUThread::process_mfc_cmd()
_xend(); _xend();
} }
else if (lock.locked)
{
data = to_write;
vm::reservation_update(raddr, 128);
lock.unlock();
result = true;
vm::notify(raddr, 128);
}
else else
{ {
// TODO maybe timeout and check if the lock is still needed in long waits (If rtime changes, no use) // TODO maybe timeout and check if the lock is still needed in long waits (If rtime changes, no use)
vm::writer_lock lock(0); vm::writer_lock lock;
if (rtime == vm::reservation_acquire(raddr, 128)) if (rtime == vm::reservation_acquire(raddr, 128))
{ {
@@ -737,7 +725,6 @@ void SPUThread::process_mfc_cmd()
} }
} }
} }
}
if (result) if (result)
{ {
-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