x86: code cleanup

This commit is contained in:
Pierre Pronchery 2025-03-20 16:25:46 +01:00
parent 084bdd18a2
commit 869a68af63
3 changed files with 4 additions and 8 deletions

View File

@ -26,11 +26,11 @@ __arch_setgdt:
/* load the GDT */
lgdt (%rcx)
/* apply the GDT */
push $0x8
lea gdt_flush, %rax
push %rax
retf
gdt_flush:
mov $0x10, %ax
mov %ax, %ds

View File

@ -9,9 +9,4 @@
# include "../i386/gdt.h"
/* public */
/* prototypes */
int _arch_setgdt64(GDT const * gdt, size_t count);
#endif /* !UKERNEL_ARCH_I386_GDT_H */
#endif /* !UKERNEL_ARCH_AMD64_GDT_H */

View File

@ -24,6 +24,7 @@ __arch_setgdt:
shl $0x3, %eax
dec %eax
mov %ax, (%ecx)
/* load the GDT */
lgdt (gdt_descriptor)
@ -34,7 +35,7 @@ __arch_setgdt:
mov %ax, %fs
mov %ax, %gs
mov %ax, %ss
ljmp $0x08, $gdt_flush
ljmp $0x8, $gdt_flush
gdt_flush:
ret