aboutsummaryrefslogtreecommitdiff
path: root/sys/arch/amd64/amd64/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64/amd64/syscall.c')
-rw-r--r--sys/arch/amd64/amd64/syscall.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/syscall.c b/sys/arch/amd64/amd64/syscall.c
index e80fe94..68235d5 100644
--- a/sys/arch/amd64/amd64/syscall.c
+++ b/sys/arch/amd64/amd64/syscall.c
@@ -42,7 +42,8 @@ __syscall(struct trapframe *tf)
.sp = tf->rsp
};
- if (args.code < __MAX_SYSCALLS) {
- tf->rax = g_syscall_table[tf->rax](&args);
+ if (args.code < __MAX_SYSCALLS && args.code > 0) {
+ args.code -= 1;
+ tf->rax = g_syscall_table[args.code](&args);
}
}