summaryrefslogtreecommitdiff
path: root/src/libc/syscall.c
diff options
context:
space:
mode:
authordzwdz2023-08-14 18:51:07 +0200
committerdzwdz2023-08-14 18:51:07 +0200
commit642b5fb0007b64c77d186fcb018d571152ee1d47 (patch)
tree1c466461f3602d306be309a053edae558ef2568e /src/libc/syscall.c
parent8050069c57b729c18c19b1a03ab6e4bf63b4735e (diff)
reorganization: first steps
Diffstat (limited to 'src/libc/syscall.c')
-rw-r--r--src/libc/syscall.c104
1 files changed, 104 insertions, 0 deletions
diff --git a/src/libc/syscall.c b/src/libc/syscall.c
new file mode 100644
index 0000000..5196683
--- /dev/null
+++ b/src/libc/syscall.c
@@ -0,0 +1,104 @@
+/* generated by syscall.c.awk
+ * don't modify manually, instead run:
+ * make src/user/lib/syscall.c
+ */
+#include <camellia/syscalls.h>
+
+
+_Noreturn void _sys_exit(long ret) {
+ _syscall(_SYS_EXIT, ret, 0, 0, 0, 0);
+ __builtin_unreachable();
+}
+
+long _sys_await(void) {
+ return _syscall(_SYS_AWAIT, 0, 0, 0, 0, 0);
+}
+
+long _sys_fork(int flags, hid_t __user *fs_front) {
+ return _syscall(_SYS_FORK, (long)flags, (long)fs_front, 0, 0, 0);
+}
+
+hid_t _sys_open(const char __user *path, long len, int flags) {
+ return (hid_t)_syscall(_SYS_OPEN, (long)path, len, (long)flags, 0, 0);
+}
+
+long _sys_mount(hid_t h, const char __user *path, long len) {
+ return _syscall(_SYS_MOUNT, (long)h, (long)path, len, 0, 0);
+}
+
+hid_t _sys_dup(hid_t from, hid_t to, int flags) {
+ return (hid_t)_syscall(_SYS_DUP, (long)from, (long)to, (long)flags, 0, 0);
+}
+
+long _sys_read(hid_t h, void __user *buf, size_t len, long offset) {
+ return _syscall(_SYS_READ, (long)h, (long)buf, (long)len, offset, 0);
+}
+
+long _sys_write(hid_t h, const void __user *buf, size_t len, long offset, int flags) {
+ return _syscall(_SYS_WRITE, (long)h, (long)buf, (long)len, offset, (long)flags);
+}
+
+long _sys_getsize(hid_t h) {
+ return _syscall(_SYS_GETSIZE, (long)h, 0, 0, 0, 0);
+}
+
+long _sys_remove(hid_t h) {
+ return _syscall(_SYS_REMOVE, (long)h, 0, 0, 0, 0);
+}
+
+long _sys_close(hid_t h) {
+ return _syscall(_SYS_CLOSE, (long)h, 0, 0, 0, 0);
+}
+
+hid_t _sys_fs_wait(char __user *buf, long max_len, struct ufs_request __user *res) {
+ return (hid_t)_syscall(_SYS_FS_WAIT, (long)buf, max_len, (long)res, 0, 0);
+}
+
+long _sys_fs_respond(hid_t hid, const void __user *buf, long ret, int flags) {
+ return _syscall(_SYS_FS_RESPOND, (long)hid, (long)buf, ret, (long)flags, 0);
+}
+
+void __user *_sys_memflag(void __user *addr, size_t len, int flags) {
+ return (void __user *)_syscall(_SYS_MEMFLAG, (long)addr, (long)len, (long)flags, 0, 0);
+}
+
+long _sys_pipe(hid_t __user user_ends[2], int flags) {
+ return _syscall(_SYS_PIPE, (long)user_ends, (long)flags, 0, 0, 0);
+}
+
+void _sys_sleep(long ms) {
+ return (void)_syscall(_SYS_SLEEP, ms, 0, 0, 0, 0);
+}
+
+void _sys_filicide(void) {
+ return (void)_syscall(_SYS_FILICIDE, 0, 0, 0, 0, 0);
+}
+
+void _sys_intr(void) {
+ return (void)_syscall(_SYS_INTR, 0, 0, 0, 0, 0);
+}
+
+void _sys_intr_set(void __user *ip) {
+ return (void)_syscall(_SYS_INTR_SET, (long)ip, 0, 0, 0, 0);
+}
+
+uint32_t _sys_getpid(void) {
+ return (uint32_t)_syscall(_SYS_GETPID, 0, 0, 0, 0, 0);
+}
+
+uint32_t _sys_getppid(void) {
+ return (uint32_t)_syscall(_SYS_GETPPID, 0, 0, 0, 0, 0);
+}
+
+int _sys_wait2(int pid, int flags, struct sys_wait2 __user *out) {
+ return (int)_syscall(_SYS_WAIT2, (long)pid, (long)flags, (long)out, 0, 0);
+}
+
+long _sys_execbuf(void __user *buf, size_t len) {
+ return _syscall(_SYS_EXECBUF, (long)buf, (long)len, 0, 0, 0);
+}
+
+void _sys_debug_klog(const void __user *buf, size_t len) {
+ return (void)_syscall(_SYS_DEBUG_KLOG, (long)buf, (long)len, 0, 0, 0);
+}
+