#pragma once #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" class ppu_thread; enum : s32 { SYS_PPU_THREAD_ONCE_INIT = 0, SYS_PPU_THREAD_DONE_INIT = 1, }; // PPU Thread Flags enum : u64 { SYS_PPU_THREAD_CREATE_JOINABLE = 0x1, SYS_PPU_THREAD_CREATE_INTERRUPT = 0x2, }; struct sys_ppu_thread_stack_t { be_t pst_addr; be_t pst_size; }; struct ppu_thread_param_t { vm::bptr entry; be_t tls; // vm::bptr }; struct sys_ppu_thread_icontext_t { be_t gpr[32]; be_t cr; be_t rsv1; be_t xer; be_t lr; be_t ctr; be_t pc; }; enum : u32 { PPU_THREAD_STATUS_IDLE, PPU_THREAD_STATUS_RUNNABLE, PPU_THREAD_STATUS_ONPROC, PPU_THREAD_STATUS_SLEEP, PPU_THREAD_STATUS_STOP, PPU_THREAD_STATUS_ZOMBIE, PPU_THREAD_STATUS_DELETED, PPU_THREAD_STATUS_UNKNOWN, }; // Syscalls void _sys_ppu_thread_exit(ppu_thread& ppu, u64 errorcode); s32 sys_ppu_thread_yield(ppu_thread& ppu); // Return value is ignored by the library error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ptr vptr); error_code sys_ppu_thread_detach(ppu_thread& ppu, u32 thread_id); error_code sys_ppu_thread_get_join_state(ppu_thread& ppu, vm::ptr isjoinable); // Error code is ignored by the library error_code sys_ppu_thread_set_priority(ppu_thread& ppu, u32 thread_id, s32 prio); error_code sys_ppu_thread_get_priority(ppu_thread& ppu, u32 thread_id, vm::ptr priop); error_code sys_ppu_thread_get_stack_information(ppu_thread& ppu, vm::ptr sp); error_code sys_ppu_thread_stop(ppu_thread& ppu, u32 thread_id); error_code sys_ppu_thread_restart(ppu_thread& ppu); error_code _sys_ppu_thread_create(ppu_thread& ppu, vm::ptr thread_id, vm::ptr param, u64 arg, u64 arg4, s32 prio, u32 stacksize, u64 flags, vm::cptr threadname); error_code sys_ppu_thread_start(ppu_thread& ppu, u32 thread_id); error_code sys_ppu_thread_rename(ppu_thread& ppu, u32 thread_id, vm::cptr name); error_code sys_ppu_thread_recover_page_fault(ppu_thread& ppu, u32 thread_id); error_code sys_ppu_thread_get_page_fault_context(ppu_thread& ppu, u32 thread_id, vm::ptr ctxt);