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:
brian218 2024-06-10 11:13:45 +08:00 committed by Elad Ashkenazi
parent 6fff22391c
commit c73302f715
4 changed files with 21 additions and 33 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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)
{
value = ppu_join_status::exited;
return CELL_EAGAIN;
}
if (value == ppu_join_status::exited)
{
return CELL_ESRCH;
}
if (value >= ppu_join_status::max)
{
return CELL_EINVAL;
}
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;
case ppu_join_status::exited:
return CELL_ESRCH;
case ppu_join_status::detached:
default:
return CELL_EINVAL;
}
});
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)
{
value = ppu_join_status::exited;
return CELL_EAGAIN;
}
if (value == ppu_join_status::exited)
{
return CELL_ESRCH;
}
if (value == ppu_join_status::detached)
{
return CELL_EINVAL;
}
if (value >= ppu_join_status::max)
{
return CELL_EBUSY;
}
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;
case ppu_join_status::exited:
return CELL_ESRCH;
default:
return CELL_EBUSY;
}
});
// Remove ID on EAGAIN