feat(libkernel_sys): declare eight Discovery stubs with the OpenOrbis signatures #10695

Merged
MarcZX10 merged 3 commits from upstream-pr/10695 into main 2026-10-28 18:27:08 +00:00
MarcZX10 commented 2026-10-24 18:20:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T18:20:40Z.


What

Replaces the (void) parameter lists of eight libkernel_sys stubs in Export.Discovery.cpp with typed ones: sceKernelGetCpuUsage(void*, int32_t*), sceKernelGetThreadName(uint32_t, char*), sceKernelLwfsAllocateBlock(int32_t, int64_t), sceKernelLwfsLseek(int32_t, int64_t, int32_t) and sceKernelLwfsWrite(int32_t, const void*, size_t) (the last two return int64_t), sceKernelLwfsSetAttribute(int32_t, int32_t), sceKernelSetCompressionAttribute(int32_t, int32_t) and sceKernelSetFsstParam(int32_t, void*). Every body still throws through NotImplemented_nid_no_patch.

Single source, stated plainly: the types are from the PS4 OpenOrbis include/orbis/libkernel.h; shadPS4 does not define these functions, so there is no second reference and nothing is measured on a PS5. off_t and ssize_t are taken as 64-bit. The Lwfs* and Set* parameters are unnamed in the header, so the names here are guesses. Proc_Stats of sceKernelGetCpuUsage is void* because its layout is unknown. The debt entry in docs/dev/debt/libkernel_sys.md says all of this. sceKernelGetIdPs and sceKernelIccSetBuzzer are left alone because the header declares them void, which would change the return type; sceKernelGetOpenPsIdForSystem and the scePthreadMutex*prioceiling pair are covered by open PRs.

Two commits: declarations, debt entry. Rebased on current main; none of the open PRs above #10640 changes these functions.

Tested

Linux, GCC, cmake --build --target libkernel_sys builds. tools/check_conventions.py --base upstream/main --head HEAD and git diff --check pass. No title or hardware run: throwing stubs, same behaviour as before.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4997961547 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10695). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T18:20:40Z. --- ### What Replaces the `(void)` parameter lists of eight `libkernel_sys` stubs in `Export.Discovery.cpp` with typed ones: `sceKernelGetCpuUsage(void*, int32_t*)`, `sceKernelGetThreadName(uint32_t, char*)`, `sceKernelLwfsAllocateBlock(int32_t, int64_t)`, `sceKernelLwfsLseek(int32_t, int64_t, int32_t)` and `sceKernelLwfsWrite(int32_t, const void*, size_t)` (the last two return `int64_t`), `sceKernelLwfsSetAttribute(int32_t, int32_t)`, `sceKernelSetCompressionAttribute(int32_t, int32_t)` and `sceKernelSetFsstParam(int32_t, void*)`. Every body still throws through `NotImplemented_nid_no_patch`. Single source, stated plainly: the types are from the PS4 OpenOrbis `include/orbis/libkernel.h`; shadPS4 does not define these functions, so there is no second reference and nothing is measured on a PS5. `off_t` and `ssize_t` are taken as 64-bit. The `Lwfs*` and `Set*` parameters are unnamed in the header, so the names here are guesses. `Proc_Stats` of `sceKernelGetCpuUsage` is `void*` because its layout is unknown. The debt entry in `docs/dev/debt/libkernel_sys.md` says all of this. `sceKernelGetIdPs` and `sceKernelIccSetBuzzer` are left alone because the header declares them `void`, which would change the return type; `sceKernelGetOpenPsIdForSystem` and the `scePthreadMutex*prioceiling` pair are covered by open PRs. Two commits: declarations, debt entry. Rebased on current `main`; none of the open PRs above #10640 changes these functions. ### Tested Linux, GCC, `cmake --build --target libkernel_sys` builds. `tools/check_conventions.py --base upstream/main --head HEAD` and `git diff --check` pass. No title or hardware run: throwing stubs, same behaviour as before. ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
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!10695
No description provided.