feat(libSceLibcInternal): implement spin lock, time and zone helpers #22431
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22431"
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 heditrigui on 2026-11-17T15:21:47Z.
What
Implements
_Lock_spin_lock,_Unlock_spin_lock,_Getzone,_Tzoff, and_GettimeinlibSceLibcInternalper Dinkumware libc specifications and firmware 13.42 disassembly:_Lock_spin_lockand_Unlock_spin_lock: Dinkumware atomic 1-byte spinlock synchronization using__atomic_exchange_nwith acquire semantics and pause instruction spinning, and__atomic_store_nwith release semantics._Getzone: returns the standard timezone separator string":"._Tzoff: returns 0 for standard UTC offset._Gettime: parses separator-delimited time string tokens, extracting field pointers and token lengths.Tested
guest_libc_internal_time_lock_testsincore/libs/tests/GuestLibcInternalTimeLock.cpptesting single-threaded acquire/release, 4-worker concurrent stress test with 10,000 iterations to verify mutex mutual exclusion and avoid race conditions, null pointer safety, zone string validation, tzoff return value, and token extraction across boundary conditions (multi-field strings, negative indices, out-of-bounds indices, empty and null strings).tools/check_conventions.py --base upstream/mainpasses with 0 findings.git diff --check.Checklist
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T15:24:08Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
71308fce31:tools/check_conventions.pypassed.guest_libc_internal_time_lock_testsbuilt cleanly.guest_libc_internal_time_lock):core/libs/prx/libSceLibcInternal/Export.cpp,core/libs/prx/libSceLibcInternal/InventoryExports2.cpp,core/libs/prx/libSceLibcInternal/include/InventoryExports2.hpp,core/libs/prx/libSceLibcInternal/include/RuntimeInternals.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me