Kernel: align userspace stacks

I was getting #GP on sse instructions
This commit is contained in:
Bananymous
2023-08-03 18:09:48 +03:00
parent c67a7cec5b
commit a11b5ae41f
2 changed files with 13 additions and 1 deletions

View File

@@ -2,6 +2,11 @@
#include <sys/syscall.h>
// stack contains
// return address
// signal number
// signal handler
.global signal_trampoline
signal_trampoline:
pushq %rax
@@ -20,6 +25,8 @@ signal_trampoline:
pushq %r14
pushq %r15
// This is 16 byte aligned
movq 128(%rsp), %rdi
movq 120(%rsp), %rax
call *%rax
@@ -46,4 +53,5 @@ signal_trampoline:
addq $16, %rsp
ret
// return over red-zone
ret $128