sharpemu/tests/SharpEmu.Libs.Tests
can 5f97d2edc4
Fix sceKernelGetTscFrequency disagreeing with the counter on non-Windows hosts (#213)
sceKernelReadTsc only returns the CPU's RDTSC when the host RDTSC reader is
available (currently 64-bit Windows); on Linux and macOS it falls back to the
QPC-based Stopwatch. ResolveKernelTscFrequency, however, still consulted the
CPUID-reported hardware TSC frequency in that case, so sceKernelGetTscFrequency
reported a multi-GHz rate while ReadTsc was ticking at the Stopwatch frequency.
A guest computing elapsed = readTscDelta / frequency then gets the wrong time
on those platforms.

Gate the calibrated/CPUID frequencies on RDTSC actually being available (the
calibration path was already self-gated; the CPUID path was not) and otherwise
report the Stopwatch frequency, keeping ReadTsc and GetTscFrequency consistent.

The selection logic is extracted into a pure, host-independent helper so both
branches can be unit tested, including a regression test asserting that a host
without RDTSC reports the Stopwatch frequency rather than the hardware TSC.
2026-07-16 00:11:46 +03:00
..
Ampr Fix pak size-collision that crashed Quake right after the intro demo (#187) 2026-07-15 01:49:41 +03:00
Json [SourceGenerators] Compile-time SysAbi export registry, analyzers, and build-generated aerolib.bin (#204) 2026-07-16 00:00:32 +03:00
Kernel Fix sceKernelGetTscFrequency disagreeing with the counter on non-Windows hosts (#213) 2026-07-16 00:11:46 +03:00
Memory Fix virtual memory allocation and access (#193) 2026-07-14 21:50:54 -06:00
Rtc Fix sceRtcConvertLocalTimeToUtc failing on non-UTC hosts (#210) 2026-07-16 00:04:35 +03:00
AerolibCatalogTests.cs [SourceGenerators] Compile-time SysAbi export registry, analyzers, and build-generated aerolib.bin (#204) 2026-07-16 00:00:32 +03:00
FakeCpuMemory.cs [Json] Implement sce::Json::Value and String (construct / set / destroy) (#169) 2026-07-15 01:49:33 +03:00
SharpEmu.Libs.Tests.csproj Fix virtual memory allocation and access (#193) 2026-07-14 21:50:54 -06:00
SysAbiRegistryTests.cs [SourceGenerators] Compile-time SysAbi export registry, analyzers, and build-generated aerolib.bin (#204) 2026-07-16 00:00:32 +03:00