summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authordzwdz2021-09-14 20:31:40 +0200
committerdzwdz2021-09-14 20:31:40 +0200
commit1d0512957e802acfe7b677b30589a4e3bd26fac8 (patch)
treef055d09bb2ef2b552473bc6fa168c6dba4e4cb55 /src/kernel
parentbfef3846f0048eee855af27406fd5d9b17a17677 (diff)
add support for 4-parameter syscalls
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/arch/generic.h2
-rw-r--r--src/kernel/arch/i386/sysenter.c2
-rw-r--r--src/kernel/syscalls.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/arch/generic.h b/src/kernel/arch/generic.h
index 547109f..dd145f7 100644
--- a/src/kernel/arch/generic.h
+++ b/src/kernel/arch/generic.h
@@ -18,7 +18,7 @@ void halt_cpu(void);
// src/arch/i386/sysenter.s
_Noreturn void sysexit(struct registers);
-int syscall_handler(int, int, int, int);
+int syscall_handler(int, int, int, int, int);
// all of those can allocate memory
struct pagedir *pagedir_new(void);
diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c
index 231aba5..6419439 100644
--- a/src/kernel/arch/i386/sysenter.c
+++ b/src/kernel/arch/i386/sysenter.c
@@ -22,7 +22,7 @@ _Noreturn void sysenter_stage2(void) {
regs->eip = (userptr_t) regs->edx;
val = syscall_handler(regs->eax, regs->ebx,
- regs->esi, regs->edi);
+ regs->esi, regs->edi, (uintptr_t)regs->ebp);
regs_savereturn(&process_current->regs, val);
process_switch(process_current); // TODO process_resume
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 6821871..9002628 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -250,7 +250,7 @@ int _syscall_memflag(void __user *addr, size_t len, int flags) {
return -1;
}
-int syscall_handler(int num, int a, int b, int c) {
+int syscall_handler(int num, int a, int b, int c, int d) {
switch (num) {
case _SYSCALL_EXIT:
_syscall_exit((userptr_t)a, b);