aboutsummaryrefslogtreecommitdiff
path: root/common/uapi/timers.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-09-15 19:21:14 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-09-15 19:46:07 +0300
commita717296a2036cede5fccfff544513043a984d614 (patch)
tree68f75a23adc298628fb9cab41fd47402a99dd19d /common/uapi/timers.c
parent619725a5f2f5272f9cbb547ed95c87312c2765a9 (diff)
downloadkmi-a717296a2036cede5fccfff544513043a984d614.tar.gz
kmi-a717296a2036cede5fccfff544513043a984d614.zip
change syscalls to take 5 params and return 6
+ In total, a syscall is built up of 6 values, with the first being the syscall number. Symmetrically, the first value is now a status and the following five values return "values". This allows us to cram in more info into the ipc_* functions. The performance difference is absolutely minimal, at least from my testing in qemu.
Diffstat (limited to 'common/uapi/timers.c')
-rw-r--r--common/uapi/timers.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/common/uapi/timers.c b/common/uapi/timers.c
index d6c6286..5c2f58f 100644
--- a/common/uapi/timers.c
+++ b/common/uapi/timers.c
@@ -35,16 +35,16 @@ static ticks_t scaled_ticks(sys_arg_t ticks, sys_arg_t mult)
/**
* Timebase syscall handler.
*
- * @return \ref OK and resolution of system timer in Hz if on 64bit system,
- * otherwise high bits of resolutio in first register and low bits in second.
+ * @return \ref OK and timebase in second argument if 64bit, otherwise high 32
+ * bits of timebase in second argument and low 32 bits in third argument.
*/
SYSCALL_DEFINE0(timebase)()
{
ticks_t t = secs_to_ticks(1);
#if defined(_LP64)
- return (struct sys_ret){ OK, t };
+ return (struct sys_ret){ OK, t, 0, 0, 0, 0 };
#else
- return (struct sys_ret){ t >> 32, t };
+ return (struct sys_ret){ OK, t >> 32, t};
#endif
}
@@ -56,17 +56,15 @@ SYSCALL_DEFINE0(timebase)()
* completeness sake.
*
* @return \ref OK and the current ticks when on 64bit systems, otherwise high
- * 32 bits of ticks in first register and low 32 bits in second.
- * \todo 32bit systems are arguably a bit unsafe with this method, should I
- * instead provide ticks_low and ticks_high or something?
+ * 32 bits of ticks in second argument and low 32 bits in third.
*/
SYSCALL_DEFINE0(ticks)()
{
ticks_t t = current_ticks();
#if defined(_LP64)
- return (struct sys_ret){ OK, t };
+ return (struct sys_ret){ OK, t, 0, 0, 0, 0};
#else
- return (struct sys_ret){ t >> 32, t };
+ return (struct sys_ret){ OK, t >> 32, t, 0, 0, 0 };
#endif
}
@@ -86,7 +84,8 @@ SYSCALL_DEFINE2(req_rel_timer)(sys_arg_t ticks, sys_arg_t mult)
return (struct sys_ret){
OK,
new_rel_timer(cur_tcb()->tid,
- scaled_ticks(ticks, mult))
+ scaled_ticks(ticks, mult)),
+ 0, 0, 0, 0
};
}
@@ -103,7 +102,8 @@ SYSCALL_DEFINE2(req_abs_timer)(sys_arg_t ticks, sys_arg_t mult)
return (struct sys_ret){
OK,
new_abs_timer(cur_tcb()->tid,
- scaled_ticks(ticks, mult))
+ scaled_ticks(ticks, mult)),
+ 0, 0, 0, 0
};
}
@@ -118,8 +118,8 @@ SYSCALL_DEFINE1(free_timer)(sys_arg_t cid)
{
struct timer *timer = find_timer(cid);
if (!timer)
- return (struct sys_ret){ ERR_NF, 0 };
+ return (struct sys_ret){ ERR_NF, 0, 0, 0, 0, 0 };
remove_timer(timer);
- return (struct sys_ret){ OK, 0 };
+ return (struct sys_ret){ OK, 0, 0, 0, 0, 0 };
}