feat(libkernel): export sceKernelGetMainSocId, sceKernelGetCpumode and sceKernelGetCpuFrequency #4466
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4466"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-12T12:35:41Z.
What
Exports three libkernel calls that PS5SX2 (PPSA99203) imports and only prints at start-up:
sceKernelGetMainSocId(0vTn5IDMU9A) andsceKernelGetCpumode(VOx8NGmHXTs) return 0. This is a silent stub, listed in TechnicalDebt.0x710f10/0x740f30; 0, 2 or 5 from param.sfo) would be wrong for a PS5.sceKernelGetCpuFrequency(iUohlUDiGac) returns the host TSC frequency already measured forsceKernelGetTscFrequency.long sceKernelGetCpuFrequency(void)is from the ps5-payload-dev SDK'ssamples/hwinfo.The names are the ones
tools/nid_names.py's aerolib list (zecoxao/sce_symbols@2883963) gives for these NIDs.PS5SX2 calls them in one block:
sceKernelGetMainSocId(&id)on a zeroedintsceKernelGetCpuFrequency()sceKernelGetCpumode()It then logs
[console] main SoC id: result=%#x out=%#xand[console] CPU: %llu Hz, cpumode %d, and builds a status string from them. No branch depends on the values. The title then calibrates the TSC itself withrdtscagainst a 50 ms wait.PS5SX2 relinks only with
--trap-sdk-syscall-stubs(#3804, see #2136), which the runs below use.mainffa19840it stops at the first call:undefined symbol: 0vTn5IDMU9AFAIL: unresolved ELF import 0vTn5IDMU9A from libkernel.prxsetitimer(#4382, #3800) on both:undefined symbol: hPWDGx8ioXQ (setitimer)FAIL: unresolved ELF import hPWDGx8ioXQ (setitimer) from libkernel.prxTested
Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release:
guest_current_cpupasses 5/5 (--repeat until-fail:5) on both. No warnings inProcess.cpp,Time.cpporGuestCurrentCpu.cpp. The new checks:sceKernelGetCpuFrequencyis positive and equal tosceKernelGetTscFrequencycheck_conventions.pypasses.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T12:36:05Z.
Progress report (
0ef9dc9→4e3aa15)📈 System libraries: 86.26% (+0.01%, +3 implemented functions)
✅ 3 implemented
sceKernelGetCpuFrequencysceKernelGetCpumodesceKernelGetMainSocId⚪ 2 behaviourally empty (constant return or throw)
sceKernelGetCpumodesceKernelGetMainSocIdImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T16:40:29Z.
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.
main)sceKernelGetCpuFrequency