Commit Graph
10 Commits
Author SHA1 Message Date
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Dean ce16645691 Merge pull request #9127 from Retr0G28/fix/equeue-rotate-level-events
fix(libkernel): move events reported by sceKernelWaitEqueue behind the waiting ones
2026-10-25 04:17:49 +13:00
Retr0 41709ae50e fix(libkernel): move events reported by sceKernelWaitEqueue behind the waiting ones
FreeBSD 11 kqueue_scan (sys/kern/kern_event.c) re-inserts a reported
knote without EV_CLEAR or EV_DISPATCH at the tail of kq_head, and
knote_enqueue puts a knote that fires again at the tail as well, so the
next scan starts with the events that were not reported yet.
sceKernelWaitEqueue scanned the event list in place, so with num smaller
than the number of ready events the first ones were reported on every
call and the later ones starved. Each reported event that stays
registered now moves to the end of the list, in the order reported.
2026-10-21 15:41:06 +03:00
Adam Franke f6b6d79aa8 fix(libkernel): return 0x80020000 | fflags from sceKernelGetEventError as a PS5 does
On a PS5 (firmware 13.40) sceKernelGetEventError returned 0 for fflags 0 and 0x80020000 | fflags otherwise, whatever flags and data held: {0x4000, 0, 22} -> 0, {0x4000, 5, 0} -> 0x80020005, {0x4000, 5, 22} -> 0x80020005, {0, 7, 22} -> 0x80020007, {0x8000, 3, 9} -> 0x80020003. fflags above 0xFFFF were not measured and throw.
2026-10-19 12:14:56 -04:00
David a0a238c86a feat(libkernel): implement sceKernelGetEventError
Return the event's data when EV_ERROR is set in its flags and 0 otherwise, as KytyPS5 does and as FreeBSD 11 kevent stores the errno of a failed change. A null event throws like the other accessors.
2026-10-12 23:07:39 +02:00
Hussein Kadhim 59517ef5f5 test(libkernel): cover blocking wait, edge and repeated AMPR equeue events
Document the level-triggered user event semantics of sceKernelWaitEqueue in TechnicalDebt.

(cherry picked from commit db79bee1e5)
2026-10-11 11:28:34 +00:00
Hussein Kadhim a9b7b20f8f fix(libkernel): report a level-triggered equeue event once per wait
A user event added with sceKernelAddUserEvent stays triggered until it is
deleted. The collection loop kept re-emitting it until the caller's event
buffer was full, so a wait with num > 1 returned the same event num times.
Like kevent, each event is now reported at most once per call; distinct
queued completions of one event are still delivered in order.

(cherry picked from commit db28ebbb7f)
2026-10-11 11:28:34 +00:00
Adrià FranchandClaude 9ab637a575 fix(libkernel): wake infinite equeue waits for timers, document timer choices
Co-Authored-By: Claude <[email protected]>
2026-10-07 18:14:04 +02:00
Adrià FranchandClaude d081e6749d feat(libkernel): sceKernelAddTimerEvent and sceKernelDeleteTimerEvent
Co-Authored-By: Claude <[email protected]>
2026-10-07 17:55:57 +02:00
DotDebianandClaude Opus 5.5 40d63b1b4c feat(libkernel): implement the sceKernelGetEvent* field accessors
sceKernelGetEventId, sceKernelGetEventFilter, sceKernelGetEventFflags,
sceKernelGetEventData and sceKernelGetEventUserData return the matching
field of the KernelEvent filled by sceKernelWaitEqueue and throw on a
null event. sceKernelGetEventError still throws NotImplemented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 10:46:15 +02:00