refactor(kernel): share SCE kernel error codes through KernelErrors.hpp #27
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by QDarkRex on 2026-09-27T06:32:32Z.
Summary
SCE kernel error codes were declared locally in each file under three different prefixes (
SCE_KERNEL_ERROR_*in Pthread/File/DirectMemory,EQUEUE_ERROR_*,KERNEL_SEMA_ERROR_*). That duplication is how the wrong values fixed in #25/#26 went unnoticed (0x8001xxxxrange,EDEADLKholding theEAGAINvalue,ETIMEDOUT=0x80020062).This PR adds
core/libs/prx/libkernel/KernelErrors.hpp, which contains:SceKernelError(errno)helper that builds0x80020000 | errno;SCE_KERNEL_ERROR_*constants for FreeBSD errno 1..94 (EPERM…ECAPMODE).Every constant was cross-checked against shadPS4's
orbis_error.h. Slots 95/96 are left out because Sony uses them for its own codes (ENOBLK,EICV) instead of FreeBSD'sENOTRECOVERABLE/EOWNERDEAD.Code changes:
Attr.cpp,Cond.cpp,Mutex.cpp,Thread.cpp,Open.cpp,DirectMemory.hpp,Equeue.hppandSemaphore.hppare removed.EQUEUE_ERROR_*/KERNEL_SEMA_ERROR_*are renamed toSCE_KERNEL_ERROR_*, including their uses inlibSceVideoOut.EQUEUE_OK/KERNEL_SEMA_OKare unchanged.No behaviour change: every constant keeps its numeric value. After normalising the prefixes, each
+line in the diff is identical to its-line.Tests
core/libs/tests/*.cppare intentionally left untouched. They hard-code the expected guest-visible values, so they check the header independently.🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-09-28T08:20:49Z.
There are two conflicts
Imported from boykopovar/AnyPS5. Originally posted by QDarkRex on 2026-09-28T08:40:09Z.
Done.