feat(libkernel): implement sceKernelGetEventError #950
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/950"
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 CnRJay on 2026-10-06T20:11:48Z.
What
Implements
sceKernelGetEventError(Uu-iDFC9aUc), which threw before.Returns the event's
datawhenEV_ERRORis set inflags, otherwise 0.The references disagree:
src/kernel/eventQueue.cpp:663, PS5)dataunderEV_ERROR, otherwise 0; 0 for a null eventkernel/ps4_queue.pas, PS4)fflags + 0x80020000whenfflagsis nonzeroThis follows KytyPS5, for three reasons:
dataunderEV_ERROR, and the Orbis/Prospero kernel derives from FreeBSD.EV_ERRORas "data contains errno".I could not check the console
libkernelbody, so the semantics are recorded under "Unknown function info" in TechnicalDebt: which field carries the error, and whether it is the raw errno or an SCE code (fpPS4's0x80020000mapping).A null event throws, like the other
sceKernelGetEvent*accessors (KytyPS5 returns 0).Tested
Windows 11 (winlibs GCC):
guest_equeue_eventspasses. It fails onmainbecause the stub throws. It checks:data = -5and noEV_ERRORreports 0.flags = EV_ADD | EV_ERRORanddata = 22reports 22, with a nonzerofflagsthat must be ignored.data = 0reports 0.tools/progress.py: libraries +1. No title run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T20:12:12Z.
Progress report (
4ddbf04→f0e7c93)📈 System libraries: 84.79% (+0.03%, +1 implemented functions)
✅ 1 implemented
sceKernelGetEventErrorImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T05:22:04Z.
Review: CHANGES_REQUESTED
Thanks for the PR. Two things to fix before this can merge:
sceKernelGetEventError, but it does:src/kernel/eventQueue.cpp:660returnsstatic_cast<int>(ev->data)whenev->flags & EV_ERROR, otherwise 0 (and returns 0 for a null event). prosper returns a constant 0 (hle_kernel_time.cpp:2488); shadPS4 is a bare stub.fflags+0x80020000, KytyPS5 (PS5 titles) reportsdataunderEV_ERROR. The PR follows fpPS4 only, and the test buildsrawEvent.fflags = 22by hand with noEV_ERROR, so it pins fpPS4's behaviour and nothing else. Please state which reference you follow and why, ideally backed by the real library (e.g. thesceKernelGetEventErrorbody in a title'slibkernel), and make the test reflect the real event shape (an event withEV_ERRORset).0x80020000mapping).Happy to re-review once updated.
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-08T18:29:59Z.
Thanks, you're right: I missed KytyPS5's body. Updated in
f0e7c93a:dataunderEV_ERROR, otherwise 0. It targets PS5, it matches FreeBSD kevent (errno indataunderEV_ERROR), and fpPS4's own header commentsEV_ERRORas "data contains errno", which contradicts itsfflagsaccessor. I don't have a consolelibkernelto disassemble, so this stays an inference.EV_ADD | EV_ERRORanddata = 22, plus a nonzerofflagsthat must be ignored. It also checks thatdatawithoutEV_ERRORgives 0.0x80020000), and the null-event difference from KytyPS5.🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by WifeInLantern on 2026-10-09T07:50:09Z.
Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, #950 merged onto current main (clean).guest_equeue_eventspasses; reverting onlyEventAccessors.cppto main makes it abort, so the test covers the change.check_conventions.py --base origin/mainpasses.#1464 and #2003 implement the same one-line behaviour (
dataunderEV_ERROR, else 0). #950 is the oldest, has CI and a review, and its debt entry is the most complete, so it looks like the one to keep. One check from #2003 is missing here: an event with every flag bit exceptEV_ERRORset must report 0.Nothing in the project currently sets
EV_ERRORon a delivered event (grep ofcoreoutside tests), so this reports 0 for every real event until something does. Not verified against the console library.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:21:48Z.
Which title reaches
sceKernelGetEventErroron main? Same question as on #1205: with the ID and the log line this can go in; otherwise I'll close it until one does.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-09T18:43:45Z.
Closing: no title on hand that reaches sceKernelGetEventError on main. Will reopen with a title ID and log line if one turns up.
Pull request closed