PPU: minor fix for ppu_join_status::max

Don't treat it as special "invalid" value.
This commit is contained in:
Nekotekina 2020-03-14 20:06:58 +03:00
parent 4e6934c9dc
commit 45389dca51
3 changed files with 5 additions and 5 deletions

View file

@ -78,7 +78,7 @@ void fmt_class_string<ppu_join_status>::format(std::string& out, u64 arg)
case ppu_join_status::detached: return "detached"; case ppu_join_status::detached: return "detached";
case ppu_join_status::zombie: return "zombie"; case ppu_join_status::zombie: return "zombie";
case ppu_join_status::exited: return "exited"; case ppu_join_status::exited: return "exited";
case ppu_join_status::max: return "invalid"; case ppu_join_status::max: break;
} }
return unknown; return unknown;

View file

@ -203,7 +203,7 @@ public:
static void stack_pop_verbose(u32 addr, u32 size) noexcept; static void stack_pop_verbose(u32 addr, u32 size) noexcept;
}; };
static_assert(ppu_join_status::max < ppu_join_status{ppu_thread::id_base}); static_assert(ppu_join_status::max <= ppu_join_status{ppu_thread::id_base});
template<typename T, typename = void> template<typename T, typename = void>
struct ppu_gpr_cast_impl struct ppu_gpr_cast_impl

View file

@ -60,7 +60,7 @@ void _sys_ppu_thread_exit(ppu_thread& ppu, u64 errorcode)
status = ppu_join_status::exited; status = ppu_join_status::exited;
}); });
if (old_status > ppu_join_status::max) if (old_status >= ppu_join_status::max)
{ {
lv2_obj::append(idm::check_unlocked<named_thread<ppu_thread>>(static_cast<u32>(old_status))); lv2_obj::append(idm::check_unlocked<named_thread<ppu_thread>>(static_cast<u32>(old_status)));
} }
@ -114,7 +114,7 @@ error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ptr<u64> vptr
return CELL_ESRCH; return CELL_ESRCH;
} }
if (value > ppu_join_status::max) if (value >= ppu_join_status::max)
{ {
return CELL_EINVAL; return CELL_EINVAL;
} }
@ -191,7 +191,7 @@ error_code sys_ppu_thread_detach(u32 thread_id)
return CELL_EINVAL; return CELL_EINVAL;
} }
if (value > ppu_join_status::max) if (value >= ppu_join_status::max)
{ {
return CELL_EBUSY; return CELL_EBUSY;
} }