diff options
author | Tom <tomut@yahoo.com> | 2021-09-03 21:25:55 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-04 22:22:58 +0200 |
commit | 123087e23587af7584930a330cbf66278f8bdf42 (patch) | |
tree | 47a11438529fddacedbe7b41b3598663d0357008 /Kernel | |
parent | d14d68c46283c5890b7d56e89ea0833f22ed6a49 (diff) | |
download | serenity-123087e23587af7584930a330cbf66278f8bdf42.zip |
Kernel: Allow specifying ecx with CPUID
Some CPUID functions (e.g. 0xb) require input values in ecx.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Arch/x86/CPUID.h | 6 |
1 files 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; } |