SPU/PPU reservations: Optimizations for reservation locks and check_state() (non-TSX)

This commit is contained in:
Eladash 2020-06-05 12:36:28 +03:00 committed by Ani
parent e09c4b72c8
commit d9750e8f9f
20 changed files with 251 additions and 252 deletions

View file

@ -61,7 +61,7 @@ void lv2_timer_context::operator()()
error_code sys_timer_create(ppu_thread& ppu, vm::ptr<u32> timer_id)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.warning("sys_timer_create(timer_id=*0x%x)", timer_id);
@ -76,7 +76,7 @@ error_code sys_timer_create(ppu_thread& ppu, vm::ptr<u32> timer_id)
error_code sys_timer_destroy(ppu_thread& ppu, u32 timer_id)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.warning("sys_timer_destroy(timer_id=0x%x)", timer_id);
@ -106,7 +106,7 @@ error_code sys_timer_destroy(ppu_thread& ppu, u32 timer_id)
error_code sys_timer_get_information(ppu_thread& ppu, u32 timer_id, vm::ptr<sys_timer_information_t> info)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.trace("sys_timer_get_information(timer_id=0x%x, info=*0x%x)", timer_id, info);
@ -128,7 +128,7 @@ error_code sys_timer_get_information(ppu_thread& ppu, u32 timer_id, vm::ptr<sys_
error_code _sys_timer_start(ppu_thread& ppu, u32 timer_id, u64 base_time, u64 period)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.trace("_sys_timer_start(timer_id=0x%x, base_time=0x%llx, period=0x%llx)", timer_id, base_time, period);
@ -185,7 +185,7 @@ error_code _sys_timer_start(ppu_thread& ppu, u32 timer_id, u64 base_time, u64 pe
error_code sys_timer_stop(ppu_thread& ppu, u32 timer_id)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.trace("sys_timer_stop()");
@ -206,7 +206,7 @@ error_code sys_timer_stop(ppu_thread& ppu, u32 timer_id)
error_code sys_timer_connect_event_queue(ppu_thread& ppu, u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.warning("sys_timer_connect_event_queue(timer_id=0x%x, queue_id=0x%x, name=0x%llx, data1=0x%llx, data2=0x%llx)", timer_id, queue_id, name, data1, data2);
@ -249,7 +249,7 @@ error_code sys_timer_connect_event_queue(ppu_thread& ppu, u32 timer_id, u32 queu
error_code sys_timer_disconnect_event_queue(ppu_thread& ppu, u32 timer_id)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.warning("sys_timer_disconnect_event_queue(timer_id=0x%x)", timer_id);
@ -283,7 +283,7 @@ error_code sys_timer_disconnect_event_queue(ppu_thread& ppu, u32 timer_id)
error_code sys_timer_sleep(ppu_thread& ppu, u32 sleep_time)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.trace("sys_timer_sleep(sleep_time=%d) -> sys_timer_usleep()", sleep_time);
@ -292,7 +292,7 @@ error_code sys_timer_sleep(ppu_thread& ppu, u32 sleep_time)
error_code sys_timer_usleep(ppu_thread& ppu, u64 sleep_time)
{
vm::temporary_unlock(ppu);
ppu.state += cpu_flag::wait;
sys_timer.trace("sys_timer_usleep(sleep_time=0x%llx)", sleep_time);