diff options
| author | Ada Christine <adachristine18@gmail.com> | 2021-04-02 19:06:27 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2021-04-02 19:06:27 +0000 |
| commit | 5084e3cc36ece00b56358e223e88523e8a191395 (patch) | |
| tree | 4415b28e6d02bda59ce53f7aeae4bbe972db3332 | |
| parent | 167481f8988a860ea6d7ea8bbdb7155e4eb7abeb (diff) | |
uneccessary complexity removed
| -rw-r--r-- | kernel/cpu.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 0d3a404..c11b3bb 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -26,23 +26,19 @@ void cpu_init(void) __asm__ volatile ( "pushf\n" - "mov %%rsp, %%rcx\n" "cli\n" "lgdt %0\n" - "movw %w2, %%ds\n" - "movw %w2, %%es\n" - "movw %w2, %%fs\n" - "movw %w2, %%gs\n" - "push %q2\n" - "push %%rcx\n" - "pushf\n" - "push %q1\n" + "mov %w2, %%ds\n" + "mov %w2, %%es\n" + "mov %w2, %%fs\n" + "mov %w2, %%gs\n" + "pushq %1\n" "lea .flush(%%rip), %%rax\n" "push %%rax\n" - "iretq\n" + "lretq\n" ".flush:\n" - "popf\n" - :: "m"(gdtr), "a"(KERNEL_CODE_SEL), "d"(KERNEL_DATA_SEL) + "popf\n" + :: "m"(gdtr), "i"(KERNEL_CODE_SEL), "r"(KERNEL_DATA_SEL) ); } |
