aboutsummaryrefslogtreecommitdiff
path: root/common/uapi/dispatch.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-07-27 20:29:28 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-07-27 20:29:28 +0300
commit3212707a9ab549119ad0ad6441a07fe774c99f3b (patch)
tree9df1e69c92dabfea37202008f77f8a100c0a7de4 /common/uapi/dispatch.c
parenta26fb216729ba7a7d0fbfc97c2082c9db512aa36 (diff)
downloadkmi-3212707a9ab549119ad0ad6441a07fe774c99f3b.tar.gz
kmi-3212707a9ab549119ad0ad6441a07fe774c99f3b.zip
use nifty variable argument count trick
+ Found it in newlib. This allows the compiler to more effectively optimize away unnecessary register operations. Applied to both kernel and init.c for a slight speed increase. I really should move init.c to some other repository though, the binary files are starting to get annoying
Diffstat (limited to 'common/uapi/dispatch.c')
-rw-r--r--common/uapi/dispatch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/uapi/dispatch.c b/common/uapi/dispatch.c
index d071db3..a9caa1e 100644
--- a/common/uapi/dispatch.c
+++ b/common/uapi/dispatch.c
@@ -23,7 +23,7 @@
SYSCALL_DEFINE0(noop)(struct tcb *t)
{
info("sys_noop\n");
- set_args(t, SYS_RET1(OK));
+ set_args1(t, OK);
}
/**
@@ -37,7 +37,7 @@ SYSCALL_DEFINE0(noop)(struct tcb *t)
SYSCALL_DEFINE1(putch)(struct tcb *t, sys_arg_t a)
{
dbg("%c", (char)a);
- set_args(t, SYS_RET1(OK));
+ set_args1(t, OK);
}
void handle_syscall(sys_arg_t syscall, sys_arg_t a, sys_arg_t b,
@@ -79,7 +79,7 @@ void handle_syscall(sys_arg_t syscall, sys_arg_t a, sys_arg_t b,
default:
error("Syscall %zu outside allowed range [0 - %i]\n", syscall,
SYS_NUM - 1);
- set_args(t, SYS_RET1(ERR_INVAL));
+ set_args1(t, ERR_INVAL);
};
if (check_canary(t)) {