mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
sys_rwlock: add vm::temporary_unlock
This commit is contained in:
parent
e1293b14f8
commit
6126a98111
@ -8,16 +8,16 @@
|
||||
#include "Emu/Cell/ErrorCodes.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
||||
|
||||
|
||||
LOG_CHANNEL(sys_rwlock);
|
||||
|
||||
template<> DECLARE(ipc_manager<lv2_rwlock, u64>::g_ipc) {};
|
||||
|
||||
extern u64 get_system_time();
|
||||
|
||||
error_code sys_rwlock_create(vm::ptr<u32> rw_lock_id, vm::ptr<sys_rwlock_attribute_t> attr)
|
||||
error_code sys_rwlock_create(ppu_thread& ppu, vm::ptr<u32> rw_lock_id, vm::ptr<sys_rwlock_attribute_t> attr)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.warning("sys_rwlock_create(rw_lock_id=*0x%x, attr=*0x%x)", rw_lock_id, attr);
|
||||
|
||||
if (!rw_lock_id || !attr)
|
||||
@ -48,8 +48,10 @@ error_code sys_rwlock_create(vm::ptr<u32> rw_lock_id, vm::ptr<sys_rwlock_attribu
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_rwlock_destroy(u32 rw_lock_id)
|
||||
error_code sys_rwlock_destroy(ppu_thread& ppu, u32 rw_lock_id)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.warning("sys_rwlock_destroy(rw_lock_id=0x%x)", rw_lock_id);
|
||||
|
||||
const auto rwlock = idm::withdraw<lv2_obj, lv2_rwlock>(rw_lock_id, [](lv2_rwlock& rw) -> CellError
|
||||
@ -77,6 +79,8 @@ error_code sys_rwlock_destroy(u32 rw_lock_id)
|
||||
|
||||
error_code sys_rwlock_rlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.trace("sys_rwlock_rlock(rw_lock_id=0x%x, timeout=0x%llx)", rw_lock_id, timeout);
|
||||
|
||||
const auto rwlock = idm::get<lv2_obj, lv2_rwlock>(rw_lock_id, [&](lv2_rwlock& rwlock)
|
||||
@ -163,8 +167,10 @@ error_code sys_rwlock_rlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
|
||||
return not_an_error(ppu.gpr[3]);
|
||||
}
|
||||
|
||||
error_code sys_rwlock_tryrlock(u32 rw_lock_id)
|
||||
error_code sys_rwlock_tryrlock(ppu_thread& ppu, u32 rw_lock_id)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.trace("sys_rwlock_tryrlock(rw_lock_id=0x%x)", rw_lock_id);
|
||||
|
||||
const auto rwlock = idm::check<lv2_obj, lv2_rwlock>(rw_lock_id, [](lv2_rwlock& rwlock)
|
||||
@ -198,6 +204,8 @@ error_code sys_rwlock_tryrlock(u32 rw_lock_id)
|
||||
|
||||
error_code sys_rwlock_runlock(ppu_thread& ppu, u32 rw_lock_id)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.trace("sys_rwlock_runlock(rw_lock_id=0x%x)", rw_lock_id);
|
||||
|
||||
const auto rwlock = idm::get<lv2_obj, lv2_rwlock>(rw_lock_id, [](lv2_rwlock& rwlock)
|
||||
@ -264,6 +272,8 @@ error_code sys_rwlock_runlock(ppu_thread& ppu, u32 rw_lock_id)
|
||||
|
||||
error_code sys_rwlock_wlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.trace("sys_rwlock_wlock(rw_lock_id=0x%x, timeout=0x%llx)", rw_lock_id, timeout);
|
||||
|
||||
const auto rwlock = idm::get<lv2_obj, lv2_rwlock>(rw_lock_id, [&](lv2_rwlock& rwlock) -> s64
|
||||
@ -375,6 +385,8 @@ error_code sys_rwlock_wlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
|
||||
|
||||
error_code sys_rwlock_trywlock(ppu_thread& ppu, u32 rw_lock_id)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.trace("sys_rwlock_trywlock(rw_lock_id=0x%x)", rw_lock_id);
|
||||
|
||||
const auto rwlock = idm::check<lv2_obj, lv2_rwlock>(rw_lock_id, [&](lv2_rwlock& rwlock)
|
||||
@ -405,6 +417,8 @@ error_code sys_rwlock_trywlock(ppu_thread& ppu, u32 rw_lock_id)
|
||||
|
||||
error_code sys_rwlock_wunlock(ppu_thread& ppu, u32 rw_lock_id)
|
||||
{
|
||||
vm::temporary_unlock(ppu);
|
||||
|
||||
sys_rwlock.trace("sys_rwlock_wunlock(rw_lock_id=0x%x)", rw_lock_id);
|
||||
|
||||
const auto rwlock = idm::get<lv2_obj, lv2_rwlock>(rw_lock_id, [&](lv2_rwlock& rwlock)
|
||||
|
@ -49,10 +49,10 @@ class ppu_thread;
|
||||
|
||||
// Syscalls
|
||||
|
||||
error_code sys_rwlock_create(vm::ptr<u32> rw_lock_id, vm::ptr<sys_rwlock_attribute_t> attr);
|
||||
error_code sys_rwlock_destroy(u32 rw_lock_id);
|
||||
error_code sys_rwlock_create(ppu_thread& ppu, vm::ptr<u32> rw_lock_id, vm::ptr<sys_rwlock_attribute_t> attr);
|
||||
error_code sys_rwlock_destroy(ppu_thread& ppu, u32 rw_lock_id);
|
||||
error_code sys_rwlock_rlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout);
|
||||
error_code sys_rwlock_tryrlock(u32 rw_lock_id);
|
||||
error_code sys_rwlock_tryrlock(ppu_thread& ppu, u32 rw_lock_id);
|
||||
error_code sys_rwlock_runlock(ppu_thread& ppu, u32 rw_lock_id);
|
||||
error_code sys_rwlock_wlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout);
|
||||
error_code sys_rwlock_trywlock(ppu_thread& ppu, u32 rw_lock_id);
|
||||
|
Loading…
Reference in New Issue
Block a user