summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordzwdz2022-05-26 21:47:37 +0200
committerdzwdz2022-05-26 21:47:37 +0200
commit2e0c1fb24d79b36ae9017591ecb2d10c6729240c (patch)
treea95641b685686157860026b5a050fd8c1b351499 /src
parent2dfecbfa898c7db2f5039c81c23a8475966ecfef (diff)
kernel/style: don't return pointless values in _syscall
Diffstat (limited to 'src')
-rw-r--r--src/kernel/syscalls.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 540611e..0d18af8 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -292,29 +292,42 @@ int _syscall(int num, int a, int b, int c, int d) {
switch (num) {
case _SYSCALL_EXIT:
_syscall_exit(a);
+ // _syscall_exit doesn't exit
case _SYSCALL_AWAIT:
- return _syscall_await();
+ _syscall_await();
+ break;
case _SYSCALL_FORK:
- return _syscall_fork(a, (userptr_t)b);
+ _syscall_fork(a, (userptr_t)b);
+ break;
case _SYSCALL_OPEN:
- return _syscall_open((userptr_t)a, b);
+ _syscall_open((userptr_t)a, b);
+ break;
case _SYSCALL_MOUNT:
- return _syscall_mount(a, (userptr_t)b, c);
+ _syscall_mount(a, (userptr_t)b, c);
+ break;
case _SYSCALL_READ:
- return _syscall_read(a, (userptr_t)b, c, d);
+ _syscall_read(a, (userptr_t)b, c, d);
+ break;
case _SYSCALL_WRITE:
- return _syscall_write(a, (userptr_t)b, c, d);
+ _syscall_write(a, (userptr_t)b, c, d);
+ break;
case _SYSCALL_CLOSE:
- return _syscall_close(a);
+ _syscall_close(a);
+ break;
case _SYSCALL_FS_WAIT:
- return _syscall_fs_wait((userptr_t)a, b, (userptr_t)c);
+ _syscall_fs_wait((userptr_t)a, b, (userptr_t)c);
+ break;
case _SYSCALL_FS_RESPOND:
- return _syscall_fs_respond((userptr_t)a, b);
+ _syscall_fs_respond((userptr_t)a, b);
+ break;
case _SYSCALL_MEMFLAG:
_syscall_memflag((userptr_t)a, b, c);
- return -1; // unused anyways
+ break;
default:
kprintf("unknown syscall ");
panic_unimplemented(); // TODO fail gracefully
}
+
+ /* return value is unused. execution continues in sysenter_stage2 */
+ return -1;
}