mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 07:51:28 +12:00
Remove some vm::reservation_lock instances
This commit is contained in:
parent
4966f6de73
commit
13de773486
2 changed files with 9 additions and 30 deletions
|
@ -2401,19 +2401,19 @@ s32 _spurs::add_workload(vm::ptr<CellSpurs> spurs, vm::ptr<u32> wid, vm::cptr<vo
|
||||||
spurs->wklIdleSpuCountOrReadyCount2[wnum] = 0;
|
spurs->wklIdleSpuCountOrReadyCount2[wnum] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vm::reservation_light_op(spurs->wklMaxContention[index], [&](atomic_t<u8>& data)
|
||||||
{
|
{
|
||||||
auto [res, rtime] = vm::reservation_lock(spurs.addr());
|
data.atomic_op([&](u8& v)
|
||||||
|
|
||||||
spurs->wklMaxContention[index].atomic_op([wnum, maxContention](u8& v)
|
|
||||||
{
|
{
|
||||||
v &= (wnum <= 15 ? ~0xf : ~0xf0);
|
v &= (wnum <= 15 ? ~0xf : ~0xf0);
|
||||||
v |= (maxContention > 8 ? 8 : maxContention) << 4;
|
v |= (maxContention > 8 ? 8 : maxContention) << 4;
|
||||||
});
|
});
|
||||||
(wnum <= 15 ? spurs->wklSignal1 : spurs->wklSignal2).fetch_and(~(0x8000 >> index));
|
});
|
||||||
|
|
||||||
res.release(rtime + 128);
|
vm::reservation_light_op<true>((wnum <= 15 ? spurs->wklSignal1 : spurs->wklSignal2), [&](atomic_be_t<u16>& data)
|
||||||
res.notify_all();
|
{
|
||||||
}
|
data &= ~(0x8000 >> index);
|
||||||
|
});
|
||||||
|
|
||||||
spurs->wklFlagReceiver.compare_and_swap(wnum, 0xff);
|
spurs->wklFlagReceiver.compare_and_swap(wnum, 0xff);
|
||||||
|
|
||||||
|
|
|
@ -146,34 +146,13 @@ namespace rsx
|
||||||
|
|
||||||
const u32 addr = get_address(offset, ctxt, HERE);
|
const u32 addr = get_address(offset, ctxt, HERE);
|
||||||
|
|
||||||
atomic_t<u64>* res{};
|
|
||||||
bool upd = false;
|
|
||||||
|
|
||||||
// TODO: Check if possible to write on reservations
|
// TODO: Check if possible to write on reservations
|
||||||
if (rsx->label_addr >> 28 != addr >> 28)
|
if (rsx->label_addr >> 28 != addr >> 28)
|
||||||
{
|
{
|
||||||
if (g_use_rtm)
|
rsx_log.fatal("NV406E semaphore unexpected address. Please report to the developers. (offset=0x%x, addr=0x%x)", offset, addr);
|
||||||
{
|
|
||||||
upd = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
res = &vm::reservation_lock(addr).first;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vm::_ref<RsxSemaphore>(addr).val = arg;
|
vm::_ref<RsxSemaphore>(addr).val = arg;
|
||||||
|
|
||||||
if (res)
|
|
||||||
{
|
|
||||||
res->fetch_add(64);
|
|
||||||
res->notify_all();
|
|
||||||
}
|
|
||||||
else if (upd)
|
|
||||||
{
|
|
||||||
// TODO: simply writing semaphore from RSX thread is wrong on TSX path
|
|
||||||
vm::reservation_update(addr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue