summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/sysenter.s
diff options
context:
space:
mode:
authordzwdz2023-09-15 00:29:11 +0200
committerdzwdz2023-09-15 00:29:11 +0200
commit458978e7b8a6d50566fc8b68558f76f6b0465c52 (patch)
tree0b2decb03e5f07fa790d7add0fc16679472012de /src/kernel/arch/amd64/sysenter.s
parent8757321821d05d2958160e1428250daf19c119e9 (diff)
kern: fix GDT order for 64bit sysret
Diffstat (limited to 'src/kernel/arch/amd64/sysenter.s')
-rw-r--r--src/kernel/arch/amd64/sysenter.s4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kernel/arch/amd64/sysenter.s b/src/kernel/arch/amd64/sysenter.s
index 6b6d684..c1af69f 100644
--- a/src/kernel/arch/amd64/sysenter.s
+++ b/src/kernel/arch/amd64/sysenter.s
@@ -1,6 +1,6 @@
// gdt.h
.set SEG_r0code, 1
-.set SEG_r3code, 3
+.set SEG_r3code32, 3
.set SEG_r3data, 4
.set IA32_STAR, 0xC0000081
@@ -15,7 +15,7 @@ sysenter_setup:
// the intel docs don't mention the lower 32 bits
mov $0, %eax
- mov $( ((SEG_r3code << 3 | 3) << 16) | (SEG_r0code << 3) ), %edx
+ mov $( ((SEG_r3code32 << 3 | 3) << 16) | (SEG_r0code << 3) ), %edx
mov $IA32_STAR, %rcx
wrmsr