From 123087e23587af7584930a330cbf66278f8bdf42 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 3 Sep 2021 21:25:55 -0600 Subject: [PATCH] Kernel: Allow specifying ecx with CPUID Some CPUID functions (e.g. 0xb) require input values in ecx. --- Kernel/Arch/x86/CPUID.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kernel/Arch/x86/CPUID.h b/Kernel/Arch/x86/CPUID.h index af05ee4c58..324d204469 100644 --- a/Kernel/Arch/x86/CPUID.h +++ b/Kernel/Arch/x86/CPUID.h @@ -12,9 +12,9 @@ namespace Kernel { class CPUID { public: - explicit CPUID(u32 function) { asm volatile("cpuid" - : "=a"(m_eax), "=b"(m_ebx), "=c"(m_ecx), "=d"(m_edx) - : "a"(function), "c"(0)); } + explicit CPUID(u32 function, u32 ecx = 0) { asm volatile("cpuid" + : "=a"(m_eax), "=b"(m_ebx), "=c"(m_ecx), "=d"(m_edx) + : "a"(function), "c"(ecx)); } u32 eax() const { return m_eax; } u32 ebx() const { return m_ebx; } u32 ecx() const { return m_ecx; }