1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

Kernel+LibSystem: Add a 4th syscall argument

Let's allow passing 4 function arguments to a syscall. The 4th argument
goes into ESI or RSI.
This commit is contained in:
Andreas Kling 2021-07-24 02:15:07 +02:00
parent 9b78ae5149
commit deff554096
5 changed files with 33 additions and 8 deletions

View file

@ -104,18 +104,20 @@ struct [[gnu::packed]] RegisterState {
#endif
}
void capture_syscall_params(FlatPtr& function, FlatPtr& arg1, FlatPtr& arg2, FlatPtr& arg3) const
void capture_syscall_params(FlatPtr& function, FlatPtr& arg1, FlatPtr& arg2, FlatPtr& arg3, FlatPtr& arg4) const
{
#if ARCH(I386)
function = eax;
arg1 = edx;
arg2 = ecx;
arg3 = ebx;
arg4 = esi;
#else
function = rax;
arg1 = rdx;
arg2 = rcx;
arg3 = rbx;
arg4 = rsi;
#endif
}