feat(libSceSystemService): implement AppMessaging queue and event flags #17144
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17144"
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 fishingpvalues on 2026-11-08T11:12:55Z.
What
The eight
sceAppMessagingexports move from thePendingExports.cppstubs intosrc/AppMessaging.cpp.SendMsg,SendMsgToShellCoreandSendMsgToShellUIvalidate the 8192-byte payload bound and accept the message. A null payload with a nonzero size or a size over the payload returns0x80C50001. The sends are outgoing: no in-process component queues a message addressed to the calling title, so they never enter the receive queue, andappId, message type and flags are not retained.ReceiveMsgblocks until a message arrives; no in-process producer exists yet, so it blocks indefinitely.TryReceiveMsgreturns0x80C50005for the empty queue; a null output returns0x80C50004in both receive forms.SetEventFlagORs andClearEventFlagclears the global 64-bit flag;TryGetEventFlagreturns the masked value and optionally clears those bits, with a null output returning0x80C50004.tests/GuestSystemServiceAppMessaging.cppis registered asguest_system_service_app_messaging, anddocs/dev/debt/libSceSystemService.mdrecords the chosen return codes and that the receive queue has no producer.Tested
Linux x86-64 (Debian 13, glibc 2.41, GCC 14.2.0), Release,
BUILD_TESTING=ON, basemainf9c2d92b91:cmake --build build --target guest_system_service_app_messaging_tests --parallel 8: passed.ctest --test-dir build -R '^guest_system_service_app_messaging$' --output-on-failure: 1/1 passed.python3 tools/check_conventions.py --base origin/main: all checks passed.mainf9c2d92b91; no conflicts.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 repositoryImported from boykopovar/AnyPS5. Originally posted by coptergui-ops on 2026-11-08T12:30:50Z.
Review: APPROVED
Reviewed at current head. All eight sceAppMessaging exports move from PendingExports stubs into src/AppMessaging.cpp: bounded 8192-byte payload copy with InvalidArgument (0x80C50001) on oversized or null-data-with-size, mutexed FIFO queue, blocking ReceiveMsg via condition_variable, Try forms returning 0x80C50005 on empty queue and 0x80C50004 on null output, global 64-bit event flag with Set/Clear/TryGet(mask, clear) semantics. Debt bullet states exactly what is modelled vs the PS5 console backend. Overlap verdict: PR 8651 (open, stale base conflicting with main) implemented sceAppMessagingTryReceiveMsg (and sceLncUtilInitialize, which this PR does not touch) - after this merges, 8651's TryReceiveMsg definition is superseded: close 8651, or rebase keeping only its sceLncUtilInitialize work. 14212 and 15947: different debt entries, no shared lines. Conventions checker: no new findings from this diff.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-12T15:20:39Z.
Review: CHANGES_REQUESTED
Checked the diff against @oneandonlydean's review of
49113a2c57; both of his points still apply to this head:src/AppMessaging.cpp:28-42,63-73:SendMsg,SendMsgToShellCoreandSendMsgToShellUIpush into the samequeuethatReceiveMsg(:54) andTryReceiveMsg(:90) pop, so a title receives its own outgoing messages (sender 0 orappId). Keep the sends out of the receive queue (accept and drop them, or record them separately for tests) so receive only returns messages addressed to the title, and updateGuestSystemServiceAppMessaging.cpplines 22-34, which pin the loopback.docs/dev/debt/libSceSystemService.md:172: name the source of0x80C50001,0x80C50004and0x80C50005(firmware or SDK header), or say they are chosen values.Once receive no longer sees sent messages,
ReceiveMsgblocks until something is delivered; note that in the debt entry too.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T13:27:11Z.
Review: COMMENTED
Reviewed — comments
Nothing blocks this review; the points below are optional.
What I ran
Reviewed head
43b9d261b9543ebeb5ce1aab420353829e2da10f. I read the prepared description, commit list, manifest, diff, and every included changed file. I did not run commands or tests;repo_read.pywas unavailable as a command in this environment.Results
Findings
Blocking
None identified in the code read.
Non-blocking
appIdis ignored by the flag APIs and the messages do not retain sender/type metadata. The debt note calls out the simplified global flag model, but this leaves per-application behavior unimplemented. Consider documenting the scope at the API boundary or implementing per-app state when the model is expanded.core/libs/prx/libSceSystemService/src/AppMessaging.cpp:29Not verified
review/files.jsonwas not available, so additional exclusions could not be confirmed.To get this to a good state
Nothing is required. Optional: clarify or expand the app-scoped event-flag behavior as the system-service model develops.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T22:35:50Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation follows the stated limited model; I found no verified blocking defect, but the review is incomplete because the removed export definitions and CMake registration context were not fully inspected.
What I ran
Reviewed head
143c36ff62285e7a16179fb5467f844f8deca773. No build or tests were run. The author reports Linux build, targeted test, and convention checks passed; those results were not independently verified.Results
Findings
Blocking
None verified in the code read.
Non-blocking
Not verified
Read
description.md,commits.md,manifest.json,diff.patch,src/AppMessaging.cpp,tests/GuestSystemServiceAppMessaging.cpp,CMakeLists.txtlines 340–382, andinclude/SystemService.hpplines 1–200. The completePendingExports.cpp, the declarations later inSystemService.hpp, and the rest of the repository context were not read. All changed paths are included in the review bundle; none were excluded per the manifest. No tests, build, negative control, Windows run, or console run was performed.To get this to a good state
Nothing is required. Optional: verify the chosen return codes and per-application semantics against console behavior when that becomes available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T18:31:47Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the findings below are optional.
What I ran
Reviewed head
9bcdf3ea05765645d32a5bad6f40fbcf2578b563. I read the full text of all six changed files and the prepared description, commits, manifest, and diff; no commands or tests were run. The author reports Linux build, targeted CTest, and conventions checks passed.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceSystemService/src/AppMessaging.cpp:18uses one process-global event flag value, and the set/clear functions ignoreappId. The description and debt note disclose this approximation. Consider documenting the limitation at the API implementation or adding per-app state when behavior is modeled more fully.Not verified
No tests or build were run in this review. Windows, console and title behavior were not verified.
review/files.jsonwas not available through the reader; the manifest and file listing show six changed files, all included, and all six were read. No excluded changed files were identified.To get this to a good state
Nothing is required. The optional points above are suggestions.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:29:28Z.
Review: COMMENTED
The Linux integration build passed the registered app-messaging CTest.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.