Commit Graph
2 Commits
Author SHA1 Message Date
erickerxhalliandClaude Opus 5.5 addd914a33 fix(libkernel): give SCE-created mutexes their priority ceiling
scePthreadMutexInit now copies the attribute's protocol and ceiling,
so a mutex made through the SCE calls, or through pthread_mutex_init,
which calls it, is priority-protected when its attribute says so. The
prioceiling getters check the handle and protocol before the output
pointer and return EINVAL for a mutex without priority protection
even with a null output, as firmware 13.42's libkernel_sys does.

The four functions are declared once in libkernel's Api.hpp with their
signatures, replacing the (void) discovery declarations in
libkernel_sys's Api.hpp and the test's local declarations. The test
adds SCE-created and mixed POSIX/SCE mutexes, and the debt entries
record the set path's kernel side as unverified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WYjMwvLdPR8iX8EP8tQYWa
2026-10-25 21:59:24 +00:00
erickerxhalliandClaude Fable 5.1 8a82455975 feat(libkernel): implement pthread_mutex_getprioceiling and setprioceiling
A mutex takes the protocol and ceiling of its attribute at init, and
pthread_mutex_getprioceiling, pthread_mutex_setprioceiling and their SCE
twins scePthreadMutexGetprioceiling and scePthreadMutexSetprioceiling
read and write it as FreeBSD 11.4 libthr and umtx do: EINVAL for a
static, adaptive or destroyed handle or a mutex without
PTHREAD_PRIO_PROTECT, and the set takes the mutex unless the caller
holds it and writes the previous ceiling. A ceiling outside the SCHED_RR
priority range throws, as the console's bound is unverified.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WYjMwvLdPR8iX8EP8tQYWa
2026-10-21 17:24:19 +00:00