File 0761-win32-arm64-call-the-function-pointer-used-by-erts_s.patch of Package erlang

From bdd5c26deb9a00e5560aba62e6747a6f2d700ee3 Mon Sep 17 00:00:00 2001
From: Cocoa <i@uwucocoa.moe>
Date: Thu, 24 Oct 2024 14:04:54 +0100
Subject: [PATCH] win32(arm64): call the function pointer used by
 erts_sys_perf_counter

Signed-off-by: Cocoa <i@uwucocoa.moe>
---
 erts/emulator/beam/jit/arm/instr_common.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/erts/emulator/beam/jit/arm/instr_common.cpp b/erts/emulator/beam/jit/arm/instr_common.cpp
index 397d5b88fe..0f9299fd59 100644
--- a/erts/emulator/beam/jit/arm/instr_common.cpp
+++ b/erts/emulator/beam/jit/arm/instr_common.cpp
@@ -3109,7 +3109,14 @@ void BeamModuleAssembler::emit_i_perf_counter() {
     Label next = a.newLabel(), small = a.newLabel();
 
     emit_enter_runtime_frame();
+
+#ifdef WIN32
+    /* Call the function pointer used by erts_sys_perf_counter */
+    runtime_call<0>(erts_sys_time_data__.r.o.sys_hrtime);
+#else
     runtime_call<0>(erts_sys_time_data__.r.o.perf_counter);
+#endif
+
     emit_leave_runtime_frame();
 
     a.asr(TMP1, ARG1, imm(SMALL_BITS - 1));
-- 
2.43.0

openSUSE Build Service is sponsored by