From a0e5603e1cf8c7e4ca8631274b9e4f3b84a661b1 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Wed, 31 Jan 2024 08:01:44 +0900 Subject: [PATCH] x86_64: cleanup lgdt --- kernel/arch/x86_64/gdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/arch/x86_64/gdt.c b/kernel/arch/x86_64/gdt.c index 70baf0aff..b51e1ebf3 100644 --- a/kernel/arch/x86_64/gdt.c +++ b/kernel/arch/x86_64/gdt.c @@ -87,15 +87,14 @@ void gdt_install(void) { gdt[0].tss.rsp[0] = (uintptr_t)&stack_top; asm volatile ( - "mov %0, %%rdi\n" - "lgdt (%%rdi)\n" + "lgdt %0\n" "mov $0x10, %%ax\n" "mov %%ax, %%ds\n" "mov %%ax, %%es\n" "mov %%ax, %%ss\n" "mov $0x33, %%ax\n" /* TSS offset */ "ltr %%ax\n" - : : "r"(&gdt[0].pointer) + : : "m"(gdt[0].pointer) : "rax", "memory" ); }