Fix stack alignment on thread entry

This commit is contained in:
flysand7 2023-09-12 02:37:54 +11:00
parent bbdcbb3e7c
commit a81d061652
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@ _rt_thread_start:
; If child, jump to thread function
pop rax ; thread_fn
pop rdi ; ctx
; Align the stack
and rsp, -16
call rax
; Make return value the first arg and call thread finish routine
mov rdi, rax