Skip to content

Commit

Permalink
x86_64: cleanup lgdt
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Jan 30, 2024
1 parent a7cad83 commit a0e5603
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/arch/x86_64/gdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
}

Expand Down

0 comments on commit a0e5603

Please sign in to comment.