aboutsummaryrefslogtreecommitdiff
path: root/include/apos/uapi.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-04-18 21:10:57 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-04-21 12:12:38 +0300
commit7967a9ab13214543041e4408086668b4db8d3e62 (patch)
tree4dab7b89bd9d5b5b8280877f9d8eb23a1edf1230 /include/apos/uapi.h
parent1ceed7525272b82c1028ebd353e65c3a63bd2714 (diff)
downloadkmi-7967a9ab13214543041e4408086668b4db8d3e62.tar.gz
kmi-7967a9ab13214543041e4408086668b4db8d3e62.zip
start working on timer subsys
Diffstat (limited to 'include/apos/uapi.h')
-rw-r--r--include/apos/uapi.h91
1 files changed, 75 insertions, 16 deletions
diff --git a/include/apos/uapi.h b/include/apos/uapi.h
index 74fd846..fb7dff7 100644
--- a/include/apos/uapi.h
+++ b/include/apos/uapi.h
@@ -1,29 +1,88 @@
#ifndef APOS_UAPI_H
#define APOS_UAPI_H
+#include <apos/syscalls.h>
#include <apos/vmem.h>
/* syscall function type, let's start with four arguments and see where that
* goes */
-typedef vm_t (*sys_t)(vm_t a0, vm_t a1, vm_t a2, vm_t a3);
+typedef vm_t (*sys_t)(vm_t, vm_t, vm_t, vm_t);
-vm_t sys_req_mem(vm_t size, vm_t flags, vm_t u0, vm_t u1);
-vm_t sys_req_pmem(vm_t paddr, vm_t size, vm_t flags, vm_t u0);
-vm_t sys_req_fixmem(vm_t start, vm_t size, vm_t flags, vm_t u0);
-vm_t sys_req_sharedmem(vm_t pid, vm_t start, vm_t size, vm_t flags);
-vm_t sys_free_mem(vm_t start, vm_t u0, vm_t u1, vm_t u2);
+#define SYSCALL_DECLARE(name)\
+ vm_t sys_##name(vm_t a, vm_t b, vm_t c, vm_t d);
-vm_t sys_ipc_server(vm_t callback, vm_t u0, vm_t u1, vm_t u2);
-vm_t sys_ipc_req(vm_t tgt_pid, vm_t d0, vm_t d1, vm_t d2);
-vm_t sys_ipc_resp(vm_t tgt_pid, vm_t ret, vm_t u0, vm_t u1);
+#define SYSCALL_DEFINE0(name)\
+ static vm_t __##name();\
+ vm_t sys_##name(vm_t a, vm_t b, vm_t c, vm_t d){ \
+ UNUSED(a);\
+ UNUSED(b);\
+ UNUSED(c);\
+ UNUSED(d);\
+ return __##name();\
+ }\
+ static vm_t __##name
-vm_t sys_fork(vm_t pid, vm_t u1, vm_t u2, vm_t u3);
-vm_t sys_exec(vm_t pid, vm_t bin, vm_t argc, vm_t argv);
-vm_t sys_signal(vm_t pid, vm_t signal, vm_t u0, vm_t u1);
-vm_t sys_switch(vm_t pid, vm_t u0, vm_t u1, vm_t u2);
-vm_t sys_sync(vm_t buf, vm_t size, vm_t u1, vm_t u2);
+#define SYSCALL_DEFINE1(name)\
+ static vm_t __##name(vm_t);\
+ vm_t sys_##name(vm_t a, vm_t b, vm_t c, vm_t d){ \
+ UNUSED(b);\
+ UNUSED(c);\
+ UNUSED(d);\
+ return __##name(a);\
+ }\
+ static vm_t __##name
-vm_t sys_conf(vm_t param, vm_t val, vm_t u0, vm_t u1);
-vm_t sys_poweroff(vm_t type, vm_t u0, vm_t u1, vm_t u2);
+#define SYSCALL_DEFINE2(name)\
+ static vm_t __##name(vm_t, vm_t);\
+ vm_t sys_##name(vm_t a, vm_t b, vm_t c, vm_t d){ \
+ UNUSED(c);\
+ UNUSED(d);\
+ return __##name(a, b);\
+ }\
+ static vm_t __##name
+
+#define SYSCALL_DEFINE3(name)\
+ static vm_t __##name(vm_t, vm_t, vm_t);\
+ vm_t sys_##name(vm_t a, vm_t b, vm_t c, vm_t d){ \
+ UNUSED(d);\
+ return __##name(a, b, c);\
+ }\
+ static vm_t __##name
+
+#define SYSCALL_DEFINE4(name)\
+ static vm_t __##name(vm_t, vm_t, vm_t, vm_t);\
+ vm_t sys_##name(vm_t a, vm_t b, vm_t c, vm_t d){ \
+ return __##name(a, b, c, d);\
+ }\
+ static vm_t __##name
+
+/* memory */
+SYSCALL_DECLARE(req_mem);
+SYSCALL_DECLARE(req_pmem);
+SYSCALL_DECLARE(req_fixmem);
+SYSCALL_DECLARE(req_sharedmem);
+SYSCALL_DECLARE(free_mem);
+
+/* timers */
+SYSCALL_DECLARE(req_timer);
+SYSCALL_DECLARE(free_timer);
+
+/* ipc */
+SYSCALL_DECLARE(ipc_server);
+SYSCALL_DECLARE(ipc_req);
+SYSCALL_DECLARE(ipc_resp);
+
+/* proc */
+SYSCALL_DECLARE(fork);
+SYSCALL_DECLARE(exec);
+SYSCALL_DECLARE(signal);
+SYSCALL_DECLARE(switch);
+SYSCALL_DECLARE(sync);
+
+/* conf */
+SYSCALL_DECLARE(conf);
+SYSCALL_DECLARE(poweroff);
+
+vm_t syscall_dispatch(vm_t syscall, vm_t a, vm_t b, vm_t c, vm_t d);
#endif /* APOS_UAPI_H */