aboutsummaryrefslogtreecommitdiff
path: root/common/uapi/proc.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-06-12 16:18:47 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-06-12 16:18:47 +0300
commit62fc51338d7259c2ea39f38bd8c7d9552e9b2002 (patch)
tree87eb670ed58b3ce0d5c0e2ad39f5c633d9e10e40 /common/uapi/proc.c
parent6c529c5c6c2d016d77b143171c5e27fbec0d2bfd (diff)
downloadkmi-62fc51338d7259c2ea39f38bd8c7d9552e9b2002.tar.gz
kmi-62fc51338d7259c2ea39f38bd8c7d9552e9b2002.zip
doxygen shows no warnings
+ Does not mean documentation is done, but it's a nice little achievement nonetheless.
Diffstat (limited to 'common/uapi/proc.c')
-rw-r--r--common/uapi/proc.c41
1 files changed, 39 insertions, 2 deletions
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 <apos/bits.h>
#include <apos/mem_regions.h>
+/**
+ * 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