[PATCH 0/1] MR8506: wineboot: Detect TSC frequency on Arm64
Otherwise the `~MHz` registry key is initialized to the maximum clock speed of the CPUs, which is known to break games. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8506
From: Ryan Houdek <Sonicadvance1(a)gmail.com> Otherwise the `~MHz` registry key is initialized to the maximum clock speed of the CPUs, which is known to break games. --- programs/wineboot/wineboot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 02d192a1982..8359e5d4c44 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -297,6 +297,15 @@ static UINT64 read_tsc_frequency(void) return freq; } +#elif defined(__aarch64__) + +static UINT64 read_tsc_frequency(void) +{ + UINT64 tsc_frequency; + __asm__ volatile( "mrs %[Res], CNTFRQ_EL0" : [Res] "=r" (tsc_frequency) ); + return tsc_frequency; +} + #else static UINT64 read_tsc_frequency(void) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8506
participants (2)
-
Ryan Houdek -
Ryan Houdek (@sonicadvance1)