Commit Graph
13 Commits
Author SHA1 Message Date
Dean GalvinandAryan Sharma c54d294a05 Merge origin/main into PR 2528
Co-authored-by: Aryan Sharma <aryan152015@gmail.com>
2026-10-21 23:12:54 +13:00
Aryan SharmaandClaude Haiku 5.5 4313a703ec feat(libkernel): implement _umtx_op UMTX_OP_SEM_WAIT and UMTX_OP_SEM_WAKE
Follow FreeBSD 11's do_sem_wait and do_sem_wake (COMPAT_FREEBSD9/10) on
a struct _usem: a wait sets _has_waiters, returns at once while _count
is non-zero and otherwise sleeps on the semaphore's queue; a wake clears
_has_waiters when one waiter is left and releases one waiter.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-20 15:01:48 +05:30
ionut27001 e6613cfb8e fix(libkernel): fail _umtx_op operation 1 with EOPNOTSUPP as measured on a PS5
Operation 1 threw as unverified, so a title whose call_once path reaches it
stopped. In a payload process on a PS5 (firmware 12.70) operations 0 and 1
fail with EOPNOTSUPP and leave the word unchanged for every word tried,
as FreeBSD 11's __umtx_op_unimpl does. Answer operation 1 like operation 0.
2026-10-19 13:08:33 +03:00
Leonardo 4b34a6d5a7 feat(libkernel): support microsecond timeout in size-0 _umtx_op 2026-10-14 22:51:54 +02:00
Dean Galvin 52813787cf fix(libkernel): defer raises while a thread holds the address-wait lock on Windows 2026-10-14 23:03:06 +13:00
Semir Kabir e92547a7a1 feat(libkernel): wake each listed address in _umtx_op UMTX_OP_NWAKE_PRIVATE 2026-10-11 17:48:06 +00:00
Adrià Franch 3879e7ed54 fix(libkernel): throw on a size-0 _umtx_op timeout that is not a valid timespec 2026-10-11 11:13:33 +02:00
Hannah Lyons 93cb3a1b0d fix(libkernel): compare the full WAIT_UINT value and throw on _umtx_op operation 1 2026-10-11 11:13:09 +02:00
clem-gbandClaude Opus 5.5 79f90f3d9b feat(libkernel): implement _umtx_op wait and wake operations
Titles that ship their own libc.prx or Unity's PS5Util.prx import
_umtx_op (04AjkP0jO9U) for atomic waits, call_once and futex-style
waits. Implement UMTX_OP_WAIT, UMTX_OP_WAKE, UMTX_OP_WAIT_UINT,
UMTX_OP_WAIT_UINT_PRIVATE and UMTX_OP_WAKE_PRIVATE as FreeBSD 11's
kern_umtx.c does, on the sceKernelSyncOnAddressWait waiter queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HeC9bA3n74TzJRYv9AgBE8
2026-10-11 11:13:08 +02:00
nahshongraham97 8df40f6579 perf(libkernel): shard SyncOnAddress waiters across hashed buckets
A single global waiter lock serializes unrelated sceKernelSyncOnAddressWait/Wake calls. Hash the address into 64 cache-line-aligned buckets so unrelated waiters no longer contend, without changing wake semantics.
2026-10-09 19:27:18 -06:00
raghav314andClaude Opus 5.5 ce6d94793c feat(libkernel): implement sceKernelSyncOnAddressWait8 and sceKernelSyncOnAddressWait16
Wait8 and Wait16 compare the 1- or 2-byte value at the address with the
comparand and share the waiter queue of the other sizes.
sceKernelSyncOnAddressWake accepts any non-null address: libc's
__std_atomic_notify_one/all pass the atomic's own address, which for 8- and
16-bit atomics need not be 4-byte aligned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 04:30:12 +05:30
Celegans12andClaude Opus 5.5 28b2a08fa7 feat(libkernel): implement sceKernelSyncOnAddressWait32 and sceKernelSyncOnAddressWait64
libc's __std_atomic_wait_direct_32 and __std_atomic_wait_direct_64
import these functions, so a libc.prx that contains the C++20 atomic
wait wrappers does not load without them. Wait32 compares a 4-byte
value and Wait64 the full 8-byte value. Both share the waiter queue
of sceKernelSyncOnAddressWait, so sceKernelSyncOnAddressWake releases
waiters of every size on the address. A null address, or one not
aligned to the value size, throws. The by-value comparand, the return
values and the 8-byte alignment of Wait64 are assumed and recorded in
TechnicalDebt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:51:32 +02:00
DotDebian ba512363b1 feat(libkernel): implement sceKernelSyncOnAddressWait and sceKernelSyncOnAddressWake
sceKernelSyncOnAddressWait parks the calling thread while the 32-bit word
at the address still holds the expected value, until
sceKernelSyncOnAddressWake releases it or the timeout expires.
sceKernelSyncOnAddressWake releases up to the requested number of threads
parked on the address, in arrival order.

The libc.prx bundled with SDK 9 titles imports both for its once
primitive, so those titles stopped at load with an unresolved import.

# Conflicts:
#	docs/dev/TechnicalDebt.md
2026-10-02 16:49:44 +03:00