summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-24 02:15:07 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-25 14:08:50 +0200
commitdeff554096652c461e62767b5e065e9d4c3ec9cc (patch)
tree088a05402c14a1dcd2149bfc467d2721926f371c /Kernel/Arch/x86
parent9b78ae5149f80d38c3ee18eb3dbf78c05c487f7c (diff)
downloadserenity-deff554096652c461e62767b5e065e9d4c3ec9cc.zip
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.
Diffstat (limited to 'Kernel/Arch/x86')
-rw-r--r--Kernel/Arch/x86/RegisterState.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Arch/x86/RegisterState.h b/Kernel/Arch/x86/RegisterState.h
index b92fd38b66..21e9fe13cd 100644
--- a/Kernel/Arch/x86/RegisterState.h
+++ b/Kernel/Arch/x86/RegisterState.h
@@ -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
}