fix(libkernel): sceKernelGetEventError #3396

Closed
fidalgojoao wants to merge 3 commits from upstream-pr/3396 into main
fidalgojoao commented 2026-10-11 09:41:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fidalgojoao on 2026-10-11T09:41:08Z.


What

Implements sceKernelGetEventError in libkernel, replacing the NotImplemented_nid_no_patch stub. It returns the event's data field as the error number when EV_ERROR is set in the event's flags (the kqueue convention) and 0 otherwise. A null event throws, like the other event accessors in the same file.

Extends GuestEqueueEvents.cpp to cover the no-error case, the EV_ERROR case and null rejection.

Not verified on PS5 hardware: I assumed the function returns the raw error number from data, not an 0x8002xxxx SCE error code. Please correct this if it is wrong.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, full build plus libs target. ctest: 573 tests, 0 failed, 3 skipped (video_out_flip_lifetime, video_out_flip_controls, guest_video_out_wqhd_detection_no_vulkan). The skipped tests also skip on an unmodified main on my machine. No title or homebrew tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4818122383 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3396). Originally posted by [fidalgojoao](https://github.com/fidalgojoao) on 2026-10-11T09:41:08Z. --- ### What Implements sceKernelGetEventError in libkernel, replacing the NotImplemented_nid_no_patch stub. It returns the event's data field as the error number when EV_ERROR is set in the event's flags (the kqueue convention) and 0 otherwise. A null event throws, like the other event accessors in the same file. Extends GuestEqueueEvents.cpp to cover the no-error case, the EV_ERROR case and null rejection. Not verified on PS5 hardware: I assumed the function returns the raw error number from data, not an 0x8002xxxx SCE error code. Please correct this if it is wrong. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, full build plus libs target. ctest: 573 tests, 0 failed, 3 skipped (video_out_flip_lifetime, video_out_flip_controls, guest_video_out_wqhd_detection_no_vulkan). The skipped tests also skip on an unmodified main on my machine. No title or homebrew tested. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 09:52:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T09:52:03Z.


Progress report (946ffa0 → 8c354e7)

📈 System libraries: 85.47% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libkernel sceKernelGetEventError
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107763086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3396#issuecomment-6107763086). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T09:52:03Z. --- <!-- progress-report --> ### Progress report (946ffa0 → 8c354e7) 📈 **System libraries**: 85.47% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libkernel | `sceKernelGetEventError` | </details>
adriadam10 commented 2026-10-11 09:56:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T09:56:48Z.


Ready to merge from my side, but the PR description fails the conventions check:

  • [pr-template] Fill in the pull request template: unchecked: Based on current main; no other open PR implements the same functions
  • [pr-template] Fill in the pull request template: unchecked: One topic per PR; follow-ups go in a new PR
  • [pr-template] Fill in the pull request template: unchecked: No comments in code except technical debt
  • [pr-template] Fill in the pull request template: unchecked: Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • [pr-template] Fill in the pull request template: unchecked: No notes, investigation .md files or images added to the repository (attach them to this PR)
  • [pr-template] Fill in the pull request template: unchecked: New third-party code is a submodule built from source
  • [pr-template] Fill in the pull request template: unchecked: Generic behaviour, not specific to one title
  • [pr-template] Fill in the pull request template: unchecked: Depends on: none

Please fill those template lines in (only you can answer AI-assisted); it merges once they pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107800114 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3396#issuecomment-6107800114). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T09:56:48Z. --- Ready to merge from my side, but the PR description fails the conventions check: - [pr-template] Fill in the pull request template: unchecked: Based on current `main`; no other open PR implements the same functions - [pr-template] Fill in the pull request template: unchecked: One topic per PR; follow-ups go in a new PR - [pr-template] Fill in the pull request template: unchecked: No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [pr-template] Fill in the pull request template: unchecked: Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [pr-template] Fill in the pull request template: unchecked: No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [pr-template] Fill in the pull request template: unchecked: New third-party code is a submodule built from source - [pr-template] Fill in the pull request template: unchecked: Generic behaviour, not specific to one title - [pr-template] Fill in the pull request template: unchecked: Depends on: none Please fill those template lines in (only you can answer AI-assisted); it merges once they pass.
fidalgojoao commented 2026-10-11 14:39:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fidalgojoao on 2026-10-11T14:39:11Z.


Hello @adriadam10 ! Done now, sorry for this mistake

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110150233 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3396#issuecomment-6110150233). Originally posted by [fidalgojoao](https://github.com/fidalgojoao) on 2026-10-11T14:39:11Z. --- Hello @adriadam10 ! Done now, sorry for this mistake
blawesom commented 2026-10-11 17:19:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T17:19:10Z.


Cross-reference: #3638 implements the same export (sceKernelGetEventError).

CONTRIBUTING.md asks authors to "check that no open pull request already implements the same functions" before starting — both PRs are open, so flagging for the maintainers.

The limitation this creates: only one of the two can be merged; the other gets closed as duplicate.

Context for the choice (independent pre-review, Linux — CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON):

  • #3638: based on current main, CLEAN, full local suite 832/832 green;
  • this branch: 223 commits behind main, currently DIRTY — and CONTRIBUTING.md also asks authors to "keep the branch up to date with main and resolve conflicts yourself", so a rebase would be needed regardless.

If it helps, rebasing onto #3638 (or closing one of them) would clear it; the choice is the maintainers'.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111623533 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3396#issuecomment-6111623533). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T17:19:10Z. --- **Cross-reference: #3638 implements the same export** (`sceKernelGetEventError`). CONTRIBUTING.md asks authors to "check that no open pull request already implements the same functions" before starting — both PRs are open, so flagging for the maintainers. **The limitation this creates:** only one of the two can be merged; the other gets closed as duplicate. Context for the choice (independent pre-review, Linux — CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`): - #3638: based on current `main`, CLEAN, full local suite 832/832 green; - this branch: 223 commits behind `main`, currently DIRTY — and CONTRIBUTING.md also asks authors to "keep the branch up to date with `main` and resolve conflicts yourself", so a rebase would be needed regardless. If it helps, rebasing onto #3638 (or closing one of them) would clear it; the choice is the maintainers'.
adriadam10 commented 2026-10-11 20:53:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T20:53:12Z.


Closing as a duplicate: #3638 implements the same export with the same behaviour ((int)data when EV_ERROR is set, else 0; null event throws like the sibling accessors), is based on current main, and has an independent Linux full-suite run. This branch conflicts with main (it predates the sceKernelGetEvent* accessors commit touching the same file), so only one of the two can land and #3638 is the one ready to merge.

Thanks for the contribution. If #3638 doesn't land, feel free to reopen rebased on main. In that case, please also check CONTRIBUTING's "no open PR implements the same functions" box against the open PR list before starting.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113634349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3396#issuecomment-6113634349). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T20:53:12Z. --- Closing as a duplicate: #3638 implements the same export with the same behaviour (`(int)data` when `EV_ERROR` is set, else 0; null event throws like the sibling accessors), is based on current `main`, and has an independent Linux full-suite run. This branch conflicts with `main` (it predates the `sceKernelGetEvent*` accessors commit touching the same file), so only one of the two can land and #3638 is the one ready to merge. Thanks for the contribution. If #3638 doesn't land, feel free to reopen rebased on `main`. In that case, please also check CONTRIBUTING's "no open PR implements the same functions" box against the open PR list before starting.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!3396
No description provided.