mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
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.
This commit is contained in:
parent
409b874514
commit
389bf82889
2 changed files with 5 additions and 0 deletions
|
@ -53,6 +53,7 @@ enum class CPUFeature : u32 {
|
|||
XSAVE = (1 << 21),
|
||||
AVX = (1 << 22),
|
||||
FXSR = (1 << 23),
|
||||
LM = (1 << 24),
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue