diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-06-26 04:21:51 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-26 11:08:52 +0200 |
commit | 389bf8288909c36547f4872720cba479883903ae (patch) | |
tree | dd83b9ca99c5469af071c9ec6037d117e0979ec8 /Kernel/Arch | |
parent | 409b874514995286fd3cfc3f397cd97e4e74a551 (diff) | |
download | serenity-389bf8288909c36547f4872720cba479883903ae.zip |
Kernel: Add CPUID flag for long mode
This isn't particularly useful because by the time we've entered
init() the CPU had better support x86_64 anyway. However this shows the
CPU flag in System Monitor - even in 32-bit mode.
Diffstat (limited to 'Kernel/Arch')
-rw-r--r-- | Kernel/Arch/x86/CPUID.h | 1 | ||||
-rw-r--r-- | Kernel/Arch/x86/common/Processor.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Arch/x86/CPUID.h b/Kernel/Arch/x86/CPUID.h index 5b094012aa..dc130b849d 100644 --- a/Kernel/Arch/x86/CPUID.h +++ b/Kernel/Arch/x86/CPUID.h @@ -53,6 +53,7 @@ enum class CPUFeature : u32 { XSAVE = (1 << 21), AVX = (1 << 22), FXSR = (1 << 23), + LM = (1 << 24), }; } diff --git a/Kernel/Arch/x86/common/Processor.cpp b/Kernel/Arch/x86/common/Processor.cpp index fd1b7e1f19..46757a6125 100644 --- a/Kernel/Arch/x86/common/Processor.cpp +++ b/Kernel/Arch/x86/common/Processor.cpp @@ -109,6 +109,8 @@ UNMAP_AFTER_INIT void Processor::cpu_detect() set_feature(CPUFeature::NX); if (extended_processor_info.edx() & (1 << 27)) set_feature(CPUFeature::RDTSCP); + if (extended_processor_info.edx() & (1 << 29)) + set_feature(CPUFeature::LM); if (extended_processor_info.edx() & (1 << 11)) { // Only available in 64 bit mode set_feature(CPUFeature::SYSCALL); @@ -260,6 +262,8 @@ String Processor::features_string() const return "xsave"; case CPUFeature::AVX: return "avx"; + case CPUFeature::LM: + return "lm"; // no default statement here intentionally so that we get // a warning if a new feature is forgotten to be added here } |