[kernel] Allow for more than three syscall args

The rcx register is used by the function call ABI for the 4th argument,
but is also clobbered by SYSCALL to hold the IP. The r10 register is
caller-saved but not part of the ABI, so stash rcx there when crossing
the syscall boundary.
This commit is contained in:
2020-09-26 22:01:21 -07:00
parent 13aee1755e
commit 67ebc58812
2 changed files with 9 additions and 6 deletions

View File

@@ -23,9 +23,11 @@ syscall_handler_prelude:
mov rbp, rsp
; account for the hole in the sysv abi
; argument list since SYSCALL uses rcx
mov rcx, r8
mov r8, r9
; argument list since SYSCALL uses rcx.
; r10 is non-preserved but not part of
; the function call ABI, so the rcx arg
; was stashed there.
mov rcx, r10
push rbx
push r11