Repository navigation
feat(libkernel): sceKernelAddTimerEvent and sceKernelDeleteTimerEvent - #807
Conversation
|
Windows CI: |
d41ab00 to
7cb154d
Compare
|
Thanks, the expiration counting and the reworked test look right to me. The test is deterministic now: every lower bound holds whatever the scheduler does, and the exact count is only checked when the elapsed time guarantees it. One functional problem and one docs point:
|
7cb154d to
00a8ec8
Compare
|
Rebased on main and fixed:
|
|
Thanks. After the last batch this branch conflicts with main in |
Co-Authored-By: Claude <noreply@anthropic.com>
|
Rebased onto main (8e281fa). The only conflict was in |
00a8ec8 to
1ab6e74
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
… choices Co-Authored-By: Claude <noreply@anthropic.com>
1ab6e74 to
9ab637a
Compare
What
Adds
sceKernelAddTimerEvent(57ZK+ODEXWY) andsceKernelDeleteTimerEvent(YWQFUyXIVdU), whichmaindoesn't declare at all.AddTimerEvent(eq, id, usec, udata)registers a periodicEVFILT_TIMER(-7) event withEV_CLEAR, reusing the equeue's existing timer scheduling (TriggerExpiredTimers/NextTimerWaitMicrosused by the HR timer).datais the number of expirations since the last delivery, and the timer stays registered after delivery. Calling it again on the same id keeps the expirations already counted and replaces the interval and userdata. Withusec == 0the event is ready again after every read, withdata == 1. This follows KytyPS5'sKernelAddTimerEventandTriggerExpiredTimers, and itsEventQueueLifetimeTests. prosper'spost_afteragrees on periodic firing and expirations-since-last-read indata(FreeBSD kqueueEVFILT_TIMER).DeleteTimerEventremoves theEVFILT_TIMERevent, returningENOENTif there isn't one. An unknown queue returnsEBADFfor both calls (shadPS4 and KytyPS5).usec / 1000indataand doesn't model periodic expirations, which looks like a placeholder. prosper's Delete always returns 0. I followed KytyPS5 (expirations indata) and shadPS4 (ENOENTon Delete).KernelEqueuePrivate::MonotonicNsis now public so the export uses the same clock as the queue. Re-adding only refreshes expired timers first forEVFILT_TIMER, so the HR timer behaves as before.Tested
Linux, GCC (Release and a fast dev build). I extended
guest_equeue_events(core/libs/tests/GuestEqueueEvents.cpp) with these cases:EBADFENOENT, including when only an HR timer has that iddata >= 5after 5 ms at 1 ms), and the timer is still delivered afterwardsusec == 0givesdata == 1on every readIt aborts on
main(the exports don't exist, so it doesn't link). Negative checks: each of these breaks the test:data = 1instead of accumulating, one-shot flag, no refresh before update, interval not updated on re-add, no deadline advance, zero interval counting while already triggered, and Delete using the HR filter. The fullguest_|libkernel|equeuectest set passes (119/119).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)