5 Commits
Author SHA1 Message Date
al3w0f205 3b5e611b36 test(libkernel): cover null thread handle and mask validation in thread affinity 2026-10-26 20:39:19 -05:00
milescovielloandClaude Opus 5.5 6508231c0e fix(libkernel): measure the TSC frequency on one CPU
sceKernelGetTscFrequency times 20 ms of TSC ticks against the monotonic
clock. A thread that moves to another CPU during the sleep reads its end
value from another TSC. Where the TSCs of the CPUs differ, as on a Windows
VM whose vCPU 0 counts about 3.8 billion ticks ahead of the others, the
frequency came out as 0 or as 180 GHz. Pin the calibrating thread to the
CPU it runs on and restore its affinity afterwards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 02:24:56 +00:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Hannah Lyons 4e3aa159d9 feat(libkernel): export sceKernelGetMainSocId, sceKernelGetCpumode and sceKernelGetCpuFrequency 2026-10-12 08:32:16 -04:00
clem-gbandClaude Opus 5.5 2ba8f75e15 fix(libkernel): report the current CPU within the thread's guest affinity
sceKernelGetCurrentCpu returned the raw host CPU index. Guest affinities
are bookkeeping only and sceKernelGetAvailableCpumask advertises CPUs 0
to 12, so on a host with more than 13 logical CPUs a title could get 13
or higher, and a thread pinned to one CPU could get another one.

The host index now selects a CPU of the calling thread's affinity
clipped to the available mask, so the result is always an advertised
CPU and a thread pinned to one CPU reports that CPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HeC9bA3n74TzJRYv9AgBE8
2026-10-08 10:47:33 +02:00