summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/sysenter.s
diff options
context:
space:
mode:
authordzwdz2022-08-28 22:23:05 +0200
committerdzwdz2022-08-28 22:23:20 +0200
commitf2eb3a78c7b69c4b8e118d91327cc5c1016481fc (patch)
tree152904ceda01fb7d067819dc483aab91d2ccd91c /src/kernel/arch/amd64/sysenter.s
parent98464ad1b65066880bc892289239bafd39fe470b (diff)
kernel/amd64: SSE support
Diffstat (limited to 'src/kernel/arch/amd64/sysenter.s')
-rw-r--r--src/kernel/arch/amd64/sysenter.s7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kernel/arch/amd64/sysenter.s b/src/kernel/arch/amd64/sysenter.s
index 8fa8acc..6b6d684 100644
--- a/src/kernel/arch/amd64/sysenter.s
+++ b/src/kernel/arch/amd64/sysenter.s
@@ -51,6 +51,12 @@ _sysexit_real:
mov %ax, %gs
*/
+ /* The state image referenced with an FXRSTOR instruction must have
+ * been saved using an FXSAVE instruction or be in the same format
+ * as required [...] will result in an incorrect state restoration. */
+ // TODO will probably end up fucking something up in a hard to debug way
+ // sorry, future me. hopefully you have learned something from this
+ fxrstor (_sysexit_regs + 128)
mov $_sysexit_regs, %rsp
pop %r15
pop %r14
@@ -86,6 +92,7 @@ sysenter_stage1:
mov $pml4_identity, %rsp
mov %rsp, %cr3
+ fxsave (_sysexit_regs + 128)
mov $(_sysexit_regs + 128), %rsp
push %rax
push %rcx