Repository navigation
feat(libkernel): export sceKernelGetMainSocId, sceKernelGetCpumode and sceKernelGetCpuFrequency - #4466
Merged
oneandonlydean merged 1 commit intoOct 12, 2026
Conversation
…d sceKernelGetCpuFrequency
Progress report (0ef9dc9 → 4e3aa15)📈 System libraries: 86.26% (+0.01%, +3 implemented functions) ✅ 3 implemented
⚪ 2 behaviourally empty (constant return or throw)
|
10 tasks done
This was referenced Oct 12, 2026
9 tasks done
|
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.
|
9 tasks done
10 tasks done
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mainffa1984 it stops at the first call:undefined symbol: 0vTn5IDMU9AFAIL: unresolved ELF import 0vTn5IDMU9A from libkernel.prxsetitimer(feat(libkernel): implement setitimer #4382, feat(libkernel): add setitimer on the alarm timer #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)