MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / sys_ppu_thread_set_priority

Function sys_ppu_thread_set_priority

kernel/cellos/src/sys_ppu_thread.cpp:311–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311error_code sys_ppu_thread_set_priority(ppu_thread &ppu, u32 thread_id,
312 s32 prio) {
313 ppu.state += cpu_flag::wait;
314
315 sys_ppu_thread.trace("sys_ppu_thread_set_priority(thread_id=0x%x, prio=%d)",
316 thread_id, prio);
317
318 if (prio < (g_ps3_process_info.debug_or_root() ? -512 : 0) || prio > 3071) {
319 return CELL_EINVAL;
320 }
321
322 if (thread_id == ppu.id) {
323 // Fast path for self
324 if (ppu.prio.load().prio != prio) {
325 lv2_obj::set_priority(ppu, prio);
326 }
327
328 return CELL_OK;
329 }
330
331 const auto thread = idm::check<named_thread<ppu_thread>>(
332 thread_id, [&, notify = lv2_obj::notify_all_t()](ppu_thread &thread) {
333 lv2_obj::set_priority(thread, prio);
334 });
335
336 if (!thread) {
337 return CELL_ESRCH;
338 }
339
340 return CELL_OK;
341}
342
343error_code sys_ppu_thread_get_priority(ppu_thread &ppu, u32 thread_id,
344 vm::ptr<s32> priop) {

Callers

nothing calls this directly

Calls 3

notify_all_tClass · 0.85
debug_or_rootMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected