mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-30 16:20:20 +00:00
sys_ppu_thread: Fixed up sys_ppu_thread_join()'s check for detached threads
sys_game: Corrected sys_game_set_system_sw_version()'s error code
This commit is contained in:
parent
6fff22391c
commit
c73302f715
@ -3264,11 +3264,11 @@ error_code sys_fs_newfs(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char>
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sys_fs_mount(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char> file_system, vm::cptr<char> path, s32 unk1, s32 prot, s32 unk3, vm::cptr<char> str1, u32 str_len)
|
||||
error_code sys_fs_mount(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char> file_system, vm::cptr<char> path, s32 unk1, s32 prot, s32 unk2, vm::cptr<char> str1, u32 str_len)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_fs.warning("sys_fs_mount(dev_name=%s, file_system=%s, path=%s, unk1=0x%x, prot=%d, unk3=0x%x, str1=%s, str_len=%d)", dev_name, file_system, path, unk1, prot, unk3, str1, str_len);
|
||||
sys_fs.warning("sys_fs_mount(dev_name=%s, file_system=%s, path=%s, unk1=0x%x, prot=%d, unk3=0x%x, str1=%s, str_len=%d)", dev_name, file_system, path, unk1, prot, unk2, str1, str_len);
|
||||
|
||||
const auto [dev_error, device_name] = translate_to_str(dev_name, false);
|
||||
|
||||
|
@ -678,7 +678,7 @@ error_code sys_fs_mapped_allocate(ppu_thread& ppu, u32 fd, u64, vm::pptr<void> o
|
||||
error_code sys_fs_mapped_free(ppu_thread& ppu, u32 fd, vm::ptr<void> ptr);
|
||||
error_code sys_fs_truncate2(ppu_thread& ppu, u32 fd, u64 size);
|
||||
error_code sys_fs_newfs(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char> file_system, s32 unk1, vm::cptr<char> str1);
|
||||
error_code sys_fs_mount(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char> file_system, vm::cptr<char> path, s32 unk1, s32 prot, s32 unk3, vm::cptr<char> str1, u32 str_len);
|
||||
error_code sys_fs_mount(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char> file_system, vm::cptr<char> path, s32 unk1, s32 prot, s32 unk2, vm::cptr<char> str1, u32 str_len);
|
||||
error_code sys_fs_unmount(ppu_thread& ppu, vm::cptr<char> path, s32 unk1, s32 force);
|
||||
error_code sys_fs_get_mount_info_size(ppu_thread& ppu, vm::ptr<u64> len);
|
||||
error_code sys_fs_get_mount_info(ppu_thread& ppu, vm::ptr<CellFsMountInfo> info, u64 len, vm::ptr<u64> out_len);
|
||||
|
@ -235,7 +235,7 @@ error_code _sys_game_set_system_sw_version(u64 version)
|
||||
sys_game.trace("sys_game_set_system_sw_version(version=%d)", version);
|
||||
|
||||
if (!g_ps3_process_info.has_root_perm())
|
||||
return CELL_EPERM;
|
||||
return CELL_ENOSYS;
|
||||
|
||||
g_fxo->get<system_sw_version>().version = version;
|
||||
|
||||
|
@ -185,24 +185,20 @@ error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ptr<u64> vptr
|
||||
{
|
||||
CellError result = thread.joiner.atomic_op([&](ppu_join_status& value) -> CellError
|
||||
{
|
||||
if (value == ppu_join_status::zombie)
|
||||
switch (value)
|
||||
{
|
||||
case ppu_join_status::joinable:
|
||||
value = ppu_join_status{ppu.id};
|
||||
return {};
|
||||
case ppu_join_status::zombie:
|
||||
value = ppu_join_status::exited;
|
||||
return CELL_EAGAIN;
|
||||
}
|
||||
|
||||
if (value == ppu_join_status::exited)
|
||||
{
|
||||
case ppu_join_status::exited:
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (value >= ppu_join_status::max)
|
||||
{
|
||||
case ppu_join_status::detached:
|
||||
default:
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
value = ppu_join_status{ppu.id};
|
||||
return {};
|
||||
});
|
||||
|
||||
if (!result)
|
||||
@ -273,29 +269,21 @@ error_code sys_ppu_thread_detach(ppu_thread& ppu, u32 thread_id)
|
||||
{
|
||||
result = thread.joiner.atomic_op([](ppu_join_status& value) -> CellError
|
||||
{
|
||||
if (value == ppu_join_status::zombie)
|
||||
switch (value)
|
||||
{
|
||||
case ppu_join_status::joinable:
|
||||
value = ppu_join_status::detached;
|
||||
return {};
|
||||
case ppu_join_status::detached:
|
||||
return CELL_EINVAL;
|
||||
case ppu_join_status::zombie:
|
||||
value = ppu_join_status::exited;
|
||||
return CELL_EAGAIN;
|
||||
}
|
||||
|
||||
if (value == ppu_join_status::exited)
|
||||
{
|
||||
case ppu_join_status::exited:
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
if (value == ppu_join_status::detached)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
if (value >= ppu_join_status::max)
|
||||
{
|
||||
default:
|
||||
return CELL_EBUSY;
|
||||
}
|
||||
|
||||
value = ppu_join_status::detached;
|
||||
return {};
|
||||
});
|
||||
|
||||
// Remove ID on EAGAIN
|
||||
|
Loading…
x
Reference in New Issue
Block a user