feat(libkernel): export sceKernelGetSocPowerConsumption #5605
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5605"
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-14T00:54:15Z.
What
sceKernelGetSocPowerConsumption(CA5jcDb2vYI, libkernel) was absent. It is now exported next tosceKernelGetCpuTemperatureandsceKernelGetSocSensorTemperatureinThermalSensors.cpp. It returnsEFAULTfor a null pointer. Otherwise it returnsEINVALand writes nothing, which is what those two return when the host has no sensor.The host's package power isn't read. On Linux the RAPL counters (
/sys/class/powercap/*/energy_uj) are readable by root only, and Windows has no general source for it. This is listed under Silent stubs indocs/dev/debt/libkernel.md.The prototype isn't documented. PS5LM Plus calls it with a zeroed 128-byte buffer at guest 0x6117C. On a 0 return it reads the first 32-bit word as milliwatts and accepts 1000 to 350000; otherwise it shows 0 W. So the parameter is a
void*, and nothing about the layout is assumed beyond not writing to it.Tested
On the PR head
31abd1a2(onmain520ee1a2), Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release:guest_thermal_sensorspasses 5/5 (--repeat until-fail:5) on both. The new check covers the null pointer and theEINVALreturn with the buffer left untouched.ThermalSensors.cpporGuestThermalSensors.cpp.PS5LM Plus (PPSA99581, catalog release 0.8.3):
mainfeddf7f4it doesn't load. Its only absent import isCA5jcDb2vYI:symbol lookup erroron Linux,FAIL: unresolved ELF importon Windows.FileStream: closed streamon Linux, and on WindowsUCRT invalid parameterthenFormatted output write failed.check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)main)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T00:54:58Z.
Progress report (
0dea07a→31abd1a)📈 System libraries: 88.19% (+0.01%, +1 implemented functions)
✅ 1 implemented
sceKernelGetSocPowerConsumptionImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T12:33:07Z.
Checked the build and ctest on the PR merged onto main:
guest_thermal_sensorspasses 5/5, and without the change the test fails (the symbol is missing). The null pointer returnsEFAULT, otherwiseEINVALwith the buffer untouched, and the Silent stubs line indocs/dev/debt/libkernel.mdis accurate; merging once the full Build is green.