aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/drivers/cpu.c6
-rw-r--r--kernel/main.c1
2 files changed, 4 insertions, 3 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)
diff --git a/kernel/main.c b/kernel/main.c
index c51adc9..93bfc29 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -29,7 +29,6 @@ int kernel_main(u32 magic, u32 addr, u32 esp)
multiboot_init(magic, addr);
memory_install();
- memory_switch_dir(virtual_kernel_dir());
cpu_enable_features();
cpu_print();