From 9ab62d05457a1eda4702335d5db5f1520d7470a2 Mon Sep 17 00:00:00 2001 From: Karutoh Date: Tue, 25 Mar 2025 16:45:18 -0700 Subject: [PATCH] Added CPU::GetCacheLineSize() definition for Windows. --- src/system/CPU_MSVC_AMD64.asm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/system/CPU_MSVC_AMD64.asm b/src/system/CPU_MSVC_AMD64.asm index 67faf9c..38ae717 100644 --- a/src/system/CPU_MSVC_AMD64.asm +++ b/src/system/CPU_MSVC_AMD64.asm @@ -6,6 +6,7 @@ global ?GetExtFeatureBits_1@CPU@ehs@@SAIXZ global ?GetExtFeatureBits_2@CPU@ehs@@SAKXZ global ?GetExtFeatureBits_3@CPU@ehs@@SAKXZ global ?GetBrand@CPU@ehs@@SAXPEAD@Z +global ?GetCacheLineSize@CPU@ehs@@SAEXZ section .text ?GetManufacturer@CPU@ehs@@SAXPEAD@Z: @@ -124,4 +125,17 @@ section .text POP RBX + RET + + ?GetCacheLineSize@CPU@ehs@@SAEXZ: + PUSH RBX + + MOV EAX, 0x80000006 + CPUID + + XOR EAX, EAX + MOV AL, CL + + POP RBX + RET \ No newline at end of file