From 62fc51338d7259c2ea39f38bd8c7d9552e9b2002 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 12 Jun 2022 16:18:47 +0300 Subject: doxygen shows no warnings + Does not mean documentation is done, but it's a nice little achievement nonetheless. --- common/uapi/proc.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'common/uapi/proc.c') diff --git a/common/uapi/proc.c b/common/uapi/proc.c index 79d243f..60617b4 100644 --- a/common/uapi/proc.c +++ b/common/uapi/proc.c @@ -12,11 +12,21 @@ #include #include +/** + * Create syscall handler. + * + * \todo Implement. + * + * @return \ref OK and 0. + */ SYSCALL_DEFINE0(create)(){ return (struct sys_ret){ OK, 0 }; } -/* Not entirely sure how I should handle forks/execs etc, mostly whether I +/** + * Fork syscall handler. + * + * \todo Not entirely sure how I should handle forks/execs etc, mostly whether I * should allow forks/execs to be called directly or only though the process * manager. Probably though the process manager, although that will add in a * slight bit of delay. @@ -25,11 +35,20 @@ SYSCALL_DEFINE0(create)(){ * that would allow them to be called directly, and then the process manager * would have to periodically ask the kernel about all threads it is aware of * via sys_sync. Dunno. + * + * @return \ref OK and 0. */ SYSCALL_DEFINE0(fork)(){ return (struct sys_ret){ OK, 0 }; } +/** + * Exec syscall handler. + * + * @param bin Binary to execute. + * @param interp Optional interpreter binary. + * @return \see prepare_proc() and 0. + */ SYSCALL_DEFINE2(exec)(sys_arg_t bin, sys_arg_t interp){ /** \todo execute new process, probably with more sensible argc passing */ struct tcb *r = cur_tcb(); @@ -60,11 +79,29 @@ SYSCALL_DEFINE2(exec)(sys_arg_t bin, sys_arg_t interp){ return (struct sys_ret){ prepare_proc(r, bin, interp), 0 }; } +/** + * Signal syscall handler. + * + * \todo Implement. + * + * @param tid Thread ID to signal. + * @param signal Signal to send to \c tid. + * @return \ref OK and 0. + */ SYSCALL_DEFINE2(signal)(sys_arg_t tid, sys_arg_t signal){ - /** \todo signals? */ return (struct sys_ret){ OK, 0 }; } +/** + * Swap syscall handler. + * + * \todo Implement. + * \todo Should swap return the registers of the new thread that would be used + * for message passing? + * + * @param tid Thread ID to swap to. + * @return \ref OK and 0. + */ SYSCALL_DEFINE1(swap)(sys_arg_t tid){ /** \todo switch to process */ /** \todo should switch return the registers of the new thread that would -- cgit v1.3