Repository navigation
feat(libc): forward the std::atomic wait and notify helpers to libkernel - #15561
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Progress report (ef9dc27 → f0e48f7)📈 System libraries: 31.87% (+0.01%, +4 implemented functions) ✅ 4 implemented
Changed libraries (implemented exports)
|
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
|
Checked the forwarding to libkernel's |
What
Add the four atomic wait and notify helpers that the
libc.prxbundled with PPSA03671 v01.001.005 (J03848509, SHA-256483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6) exports forstd::atomic::waitandnotify:__std_atomic_wait_direct_32kSLphkBuz6E0x10EA60__std_atomic_wait_direct_64kzfKNNi3eew0x10EAE0__std_atomic_notify_one_directdlNEq6BfzDk0x10EB60__std_atomic_notify_all_directTpT-GpWLpEo0x10EBA0In that module they only forward to libkernel:
sceKernelSyncOnAddressWait32/Wait64with the address, the expected value and the nameSceLibcV2AtomicWait. A timeout of 0xffffffff milliseconds passes no timeout. Any other passes milliseconds × 1000 as microseconds, or 0xffffffff when the timeout is 0x418938 milliseconds or more, including values wider than 32 bits. They return 1 whatever libkernel returns;sceKernelSyncOnAddressWakewith 1 or 0x7fffffff waiters.libc cannot call libkernel directly, so this follows the
FilesystemForwardspattern:AtomicWaitForwards.hppdeclares the three calls, libkernel'sSyncOnAddressregisters them when it loads, and libc'sAtomicWait.cppuses them. A libc waiter and a libkernel waiter therefore share libkernel's wait queue. Without libkernel loaded, the helpers throw.Tested
Windows x86-64, WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON, main1e658521a0a. Exact tested commit:8fca613fad7.guest_std_atomic_waitandguest_std_atomic_wait_kernelpass, along with libkernel'sguest_sync_on_addresstests,guest_sigvec,guest_sce_v2_filesystem_calls,guest_sce_v2_exceptions,guest_math_exactandpublic_headers.guest_std_atomic_waitregisters recording forwards and checks each argument: the address, the 32- and 64-bit expected values, the absent timeout for 0xffffffff, 0, 5, 0x418937 and 0x418938 milliseconds and a timeout wider than 32 bits, the name, the waiter counts, and that the waits return 1 when libkernel returns an error.guest_std_atomic_wait_kernellinks the real libkernel. A different value returns at once, a 20 ms wait times out after at least 15 ms, and a blocked libc waiter is released by libc'snotify_alland by libkernel'ssceKernelSyncOnAddressWake. A waiter blocked insceKernelSyncOnAddressWait64is released by libc'snotify_one. It passed three runs in a row.notify_allwaking one waiter, andnotify_onewaking none.guest_std_atomic_waitfailed on each. The source was then restored byte for byte (SHA-256 checked) and rebuilt, and both tests passed again.git diff --checkpass.tools/pr_overlap.pyread 1,772 open PRs and reports no overlap. It keeps exit 2 for 45 branches that already conflict with main. None of them names these helpers. Merging each of the 45 with this branch and with main usinggit merge-treegives the same conflict blocks. The branch also merges cleanly with feat(libc): export the std::__sce_v2 extended-precision helpers #15336, feat(libc): export the std::__sce_v2 multiprecision helpers #15471, feat(libc): export the std::__sce_v2 _Poly and _XLgamma helpers #15484, feat(libc): export the std::__sce_v2 _Xtime_diff_to_millis2 helper #15490, feat(libc): export the std::__sce_v2 _Exp and _FExp helpers #15501, feat(libc): export the std::__sce_v2 _Pmsw, _FPmsw and _LPmsw helpers #15519 and feat(libc): throw std::bad_cast and the std::__sce_v2 bad_any_cast, format_error and future_error #15552.Not tested: Linux, macOS, another SDK, a game, GPU or console. No game compatibility claim. No original module, extracted bytes, harness or log is committed or uploaded.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code