x86_64: cleanup lgdt

This commit is contained in:
K. Lange 2024-01-31 08:01:44 +09:00
parent a7cad83e78
commit a0e5603e1c

View File

@ -87,15 +87,14 @@ void gdt_install(void) {
gdt[0].tss.rsp[0] = (uintptr_t)&stack_top; gdt[0].tss.rsp[0] = (uintptr_t)&stack_top;
asm volatile ( asm volatile (
"mov %0, %%rdi\n" "lgdt %0\n"
"lgdt (%%rdi)\n"
"mov $0x10, %%ax\n" "mov $0x10, %%ax\n"
"mov %%ax, %%ds\n" "mov %%ax, %%ds\n"
"mov %%ax, %%es\n" "mov %%ax, %%es\n"
"mov %%ax, %%ss\n" "mov %%ax, %%ss\n"
"mov $0x33, %%ax\n" /* TSS offset */ "mov $0x33, %%ax\n" /* TSS offset */
"ltr %%ax\n" "ltr %%ax\n"
: : "r"(&gdt[0].pointer) : : "m"(gdt[0].pointer) : "rax", "memory"
); );
} }