feat(libkernel): implement sceKernelGetProcessAbiType #11939

Merged
ionut27001 merged 1 commit from upstream-pr/11939 into main 2026-11-08 06:40:13 +00:00
ionut27001 commented 2026-10-27 13:13:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ionut27001 on 2026-10-27T13:13:35Z.


What

Implements sceKernelGetProcessAbiType(int pid) in core/libs/prx/libkernel/System/src/Process.cpp and removes the throwing declaration from Unimplemented.cpp. The own pid and -1 return 1, pid 0 returns 0, and any other pid throws as unmodelled; the second argument is ignored here, and whether the export uses one is unknown. The debt entry says what is still open: other existing pids, which process pid 0 names, the meaning of the values, and a title process.

Measured in two payload process runs on a PS5 (firmware 12.70), p85 and p86 (E:/CLI/ps5-oracle/results/20261027T103808Z_p85_libkernel/result.log, E:/CLI/ps5-oracle/results/20261027T104816Z_p86_libkernel/result.log), result in rax:

  • own getpid() (108): 1 with a 16-byte 0xa5 buffer and with null as the second argument (p86 lines case abi_out pid=108 rax=0x1 buf=a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5, case abi_null pid=108 rax=0x1)
  • -1: 1 (p86 case abi_out pid=-1 rax=0x1 buf=a5a5..., case abi_null pid=-1 rax=0x1)
  • 0: 0 (p86 case abi_out pid=0 rax=0 buf=a5a5..., case abi_null pid=0 rax=0)
  • a stack pointer and an unspecified first argument: 0x80020003 (p85 v2 case abi_buf rax=0x80020003 buf=0000..., case abi_noarg rax=0x80020003)
  • in the three p86 abi_out cases the 16-byte 0xa5 buffer passed as the second argument was not written.

Other existing pids were not tried, so they throw here instead of returning SCE_KERNEL_ERROR_ESRCH, which was seen only for a stack pointer and an unspecified first argument (p85). PS5_MihawkOS (PPSA99170) imports this export.

Tested

Windows 11, WinLibs GCC 15.2.0 (Release, Ninja), commit 4fddc50616 on main 75f3702aed (the revert check below ran on ea35db574d, the same code on main 431a5156b9):

  • ctest -R ^guest_process_abi_type$ passed twice.
  • With the function body (main's throwing stub with the new signature, since main declares no argument) restored from main and rebuilt, the same test aborts (sceKernelGetProcessAbiType not implemented).
  • Linux and macOS were not built or run.

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 under Silent stubs in their library's technical debt file
  • 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: #9326 and #12060 (only docs/dev/debt/libkernel.md conflicts; this lands after both and rebases)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5034498148 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11939). Originally posted by [ionut27001](https://github.com/ionut27001) on 2026-10-27T13:13:35Z. --- ### What Implements `sceKernelGetProcessAbiType(int pid)` in `core/libs/prx/libkernel/System/src/Process.cpp` and removes the throwing declaration from `Unimplemented.cpp`. The own pid and -1 return 1, pid 0 returns 0, and any other pid throws as unmodelled; the second argument is ignored here, and whether the export uses one is unknown. The debt entry says what is still open: other existing pids, which process pid 0 names, the meaning of the values, and a title process. Measured in two payload process runs on a PS5 (firmware 12.70), p85 and p86 (`E:/CLI/ps5-oracle/results/20261027T103808Z_p85_libkernel/result.log`, `E:/CLI/ps5-oracle/results/20261027T104816Z_p86_libkernel/result.log`), result in `rax`: - own `getpid()` (108): 1 with a 16-byte `0xa5` buffer and with null as the second argument (p86 lines `case abi_out pid=108 rax=0x1 buf=a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5`, `case abi_null pid=108 rax=0x1`) - -1: 1 (p86 `case abi_out pid=-1 rax=0x1 buf=a5a5...`, `case abi_null pid=-1 rax=0x1`) - 0: 0 (p86 `case abi_out pid=0 rax=0 buf=a5a5...`, `case abi_null pid=0 rax=0`) - a stack pointer and an unspecified first argument: `0x80020003` (p85 v2 `case abi_buf rax=0x80020003 buf=0000...`, `case abi_noarg rax=0x80020003`) - in the three p86 `abi_out` cases the 16-byte `0xa5` buffer passed as the second argument was not written. Other existing pids were not tried, so they throw here instead of returning `SCE_KERNEL_ERROR_ESRCH`, which was seen only for a stack pointer and an unspecified first argument (p85). PS5_MihawkOS (PPSA99170) imports this export. ### Tested Windows 11, WinLibs GCC 15.2.0 (Release, Ninja), commit 4fddc50616 on main 75f3702aed (the revert check below ran on ea35db574d, the same code on main 431a5156b9): - `ctest -R ^guest_process_abi_type$` passed twice. - With the function body (main's throwing stub with the new signature, since main declares no argument) restored from main and rebuilt, the same test aborts (`sceKernelGetProcessAbiType not implemented`). - Linux and macOS were not built or run. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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: #9326 and #12060 (only `docs/dev/debt/libkernel.md` conflicts; this lands after both and rebases) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 13:18:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T13:18:50Z.

Review: DISMISSED


The implementation is supported by the measured own-pid, -1, and 0 cases; my local syntax, conventions, and NID checks pass. I found one contribution-rule blocker before approval: #9326 is open and changes the same docs/dev/debt/libkernel.md region. I fetched both exact heads and ran git merge-tree against their common base; the merge conflicts in that debt file (the shared CMake/API files merge cleanly). Please coordinate the agreed landing order with #9326 and record it in Depends on/the overlap note, or rebase and update the report after one lands. The hosted Windows test and policy checks are still running; this request is specifically for the confirmed documentation conflict.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5667664173 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11939#pullrequestreview-5667664173). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T13:18:50Z. **Review:** DISMISSED --- The implementation is supported by the measured own-pid, `-1`, and `0` cases; my local syntax, conventions, and NID checks pass. I found one contribution-rule blocker before approval: #9326 is open and changes the same `docs/dev/debt/libkernel.md` region. I fetched both exact heads and ran `git merge-tree` against their common base; the merge conflicts in that debt file (the shared CMake/API files merge cleanly). Please coordinate the agreed landing order with #9326 and record it in `Depends on`/the overlap note, or rebase and update the report after one lands. The hosted Windows test and policy checks are still running; this request is specifically for the confirmed documentation conflict.
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!11939
No description provided.