Index: mod/kcore/syscall.fn.x86.lin.64.s ================================================================== --- mod/kcore/syscall.fn.x86.lin.64.s +++ mod/kcore/syscall.fn.x86.lin.64.s @@ -34,16 +34,17 @@ ; arg 1 = errno ptr ; arg 2 = syscall num ; arg 3 = valency ; arg 4 = args ptr - ; we use two registers that are supposed + ; we use three registers that are supposed ; to be callee-saved, so we need to ; push them to the stack and then pop ; them back off just before the fn rets. push rbx push r12 + push r15 ; store the locals in registers that ; are guaranteed not to be clobbered, ; saving us some cycles pushing to ; and popping back from the stack @@ -101,8 +102,9 @@ .error: neg sys.reg.ret mov qword [rbx], -1 mov [r12], sys.reg.ret jmp .return - .return: pop r12 + .return: pop r15 + pop r12 pop rbx ret