x86: code cleanup
This commit is contained in:
parent
084bdd18a2
commit
869a68af63
|
@ -26,11 +26,11 @@ __arch_setgdt:
|
||||||
/* load the GDT */
|
/* load the GDT */
|
||||||
lgdt (%rcx)
|
lgdt (%rcx)
|
||||||
|
|
||||||
|
/* apply the GDT */
|
||||||
push $0x8
|
push $0x8
|
||||||
lea gdt_flush, %rax
|
lea gdt_flush, %rax
|
||||||
push %rax
|
push %rax
|
||||||
retf
|
retf
|
||||||
|
|
||||||
gdt_flush:
|
gdt_flush:
|
||||||
mov $0x10, %ax
|
mov $0x10, %ax
|
||||||
mov %ax, %ds
|
mov %ax, %ds
|
||||||
|
|
|
@ -9,9 +9,4 @@
|
||||||
|
|
||||||
# include "../i386/gdt.h"
|
# include "../i386/gdt.h"
|
||||||
|
|
||||||
|
#endif /* !UKERNEL_ARCH_AMD64_GDT_H */
|
||||||
/* public */
|
|
||||||
/* prototypes */
|
|
||||||
int _arch_setgdt64(GDT const * gdt, size_t count);
|
|
||||||
|
|
||||||
#endif /* !UKERNEL_ARCH_I386_GDT_H */
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ __arch_setgdt:
|
||||||
shl $0x3, %eax
|
shl $0x3, %eax
|
||||||
dec %eax
|
dec %eax
|
||||||
mov %ax, (%ecx)
|
mov %ax, (%ecx)
|
||||||
|
|
||||||
/* load the GDT */
|
/* load the GDT */
|
||||||
lgdt (gdt_descriptor)
|
lgdt (gdt_descriptor)
|
||||||
|
|
||||||
|
@ -34,7 +35,7 @@ __arch_setgdt:
|
||||||
mov %ax, %fs
|
mov %ax, %fs
|
||||||
mov %ax, %gs
|
mov %ax, %gs
|
||||||
mov %ax, %ss
|
mov %ax, %ss
|
||||||
ljmp $0x08, $gdt_flush
|
ljmp $0x8, $gdt_flush
|
||||||
gdt_flush:
|
gdt_flush:
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
Loading…
Reference in New Issue
Block a user