From 099a7fbbc35a71f98553fa39899f2d17c555242f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Fri, 2 May 2025 14:49:06 +0000 Subject: Finish implementing 8-byte GDT entries and syscall arg loads. --- arch/x86_64/src/kernel/cpu/call.cpp | 4 ++-- arch/x86_64/src/kernel/cpu/tr.cpp | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'arch/x86_64/src/kernel/cpu') diff --git a/arch/x86_64/src/kernel/cpu/call.cpp b/arch/x86_64/src/kernel/cpu/call.cpp index 932d248..6564b76 100644 --- a/arch/x86_64/src/kernel/cpu/call.cpp +++ b/arch/x86_64/src/kernel/cpu/call.cpp @@ -4,7 +4,7 @@ namespace teachos::arch::kernel::cpu { auto call(far_pointer pointer) -> void { - // asm volatile("rex64 lcall *%[input]" : /* no output from call */ : [input] "m"(pointer)); - asm volatile("ljmp *%0" : : "m"(pointer)); + asm volatile("rex64 lcall *%[input]" : /* no output from call */ : [input] "m"(pointer)); + // asm volatile("ljmp *%0" : : "m"(pointer)); } } // namespace teachos::arch::kernel::cpu diff --git a/arch/x86_64/src/kernel/cpu/tr.cpp b/arch/x86_64/src/kernel/cpu/tr.cpp index e281189..a435540 100644 --- a/arch/x86_64/src/kernel/cpu/tr.cpp +++ b/arch/x86_64/src/kernel/cpu/tr.cpp @@ -11,12 +11,6 @@ namespace teachos::arch::kernel::cpu auto load_task_register(uint16_t gdt_offset) -> void { - // asm volatile("ltr %[input]" : /* no output from call */ : [input] "R"(gdt_offset)); - // https://www.scs.stanford.edu/05au-cs240c/lab/i386/s07_03.htm - asm volatile("mov %[input], %%ax\n" - "ltr %%ax\n" - : /* no output from call */ - : [input] "r"(gdt_offset) - : "ax"); + asm volatile("ltr %[input]" : /* no output from call */ : [input] "m"(gdt_offset)); } } // namespace teachos::arch::kernel::cpu -- cgit v1.2.3