Commit Graph
15 Commits
Author SHA1 Message Date
Dean 4d45fd2235 Merge pull request #12471 from Oscar45397/test/libkernel-delete-hrtimer-event
test(libkernel): cover sceKernelDeleteHRTimerEvent
2026-11-03 02:37:50 +13:00
Dean Galvin efd499f60d Merge commit 'f1a7b02028ae50adaf6c5aaaef892a51841b25bf' into HEAD
# Conflicts:
#	core/libs/prx/libkernel/Equeue/Equeue.cpp
#	core/libs/tests/GuestEqueueEvents.cpp
#	docs/dev/debt/libkernel.md
2026-11-02 03:00:24 +13:00
Oscar45397andClaude Opus 5.5 911926b51a test(libkernel): cover sceKernelDeleteHRTimerEvent
No test called sceKernelDeleteHRTimerEvent. VerifyHRTimerDelete checks
it as FreeBSD's kevent EV_DELETE for the HR timer filter: EBADF on queue
0, ENOENT for a timer that was never added or is already deleted, only
the HR timer of an id removed while a regular timer of the same id stays,
and a fired timer deleted before it is collected no longer reported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:04:44 +01:00
orezraeyandClaude Opus 5.5 2d339842eb fix(libkernel): add 0x80020000 to any event fflags in sceKernelGetEventError as measured on a PS5
On PS5 firmware 13.60 sceKernelGetEventError returns 0x80020000 plus the
event's fflags in 32 bits for every non-zero fflags, including values
above 0xFFFF, where it used to throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 11:25:04 -03:00
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
Pouare514 c170bba422 fix(libkernel): bound equeue pending events
Undrained triggers queued without limit and AddEvent copied the whole queue, so a flip/vblank flood could exhaust the host heap while guest memory stayed free. Keep the armed event plus at most 64 queued events per registration, dropping the oldest queued event past the cap and keeping the latest payload; an AddEvent carrying more keeps the latest 64. Drained bursts report as before.
2026-10-18 12:15:06 +02: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