aboutsummaryrefslogtreecommitdiff
path: root/kernel/drivers/cpu.c
diff options
context:
space:
mode:
authorMarvin Borner2021-05-18 22:06:59 +0200
committerMarvin Borner2021-05-18 22:07:19 +0200
commit45bfdffcb2e00fda595b3f9318469f6b0d29cbe4 (patch)
treef78d66a7687aeb5c4fe4806adf60f70bab95dd9b /kernel/drivers/cpu.c
parentc905cd632cc7c5fa8e61eae7c00ed8e14743ced9 (diff)
Fixed issues with intel emulation
Diffstat (limited to 'kernel/drivers/cpu.c')
-rw-r--r--kernel/drivers/cpu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/drivers/cpu.c b/kernel/drivers/cpu.c
index 5d53bef..296e73a 100644
--- a/kernel/drivers/cpu.c
+++ b/kernel/drivers/cpu.c
@@ -179,12 +179,14 @@ CLEAR void cpu_enable_features(void)
void clac(void)
{
- __asm__ volatile("clac" ::: "cc");
+ if (cpu_extended_features.ebx & CPUID_EXT_FEAT_EBX_SMAP)
+ __asm__ volatile("clac" ::: "cc");
}
void stac(void)
{
- __asm__ volatile("stac" ::: "cc");
+ if (cpu_extended_features.ebx & CPUID_EXT_FEAT_EBX_SMAP)
+ __asm__ volatile("stac" ::: "cc");
}
CLEAR void cli(void)