13#include <sys/select.h>
17#include <mos/platform_syscall.h>
21#error "This file should not be included in the kernel!"
52 __builtin_unreachable();
93 __builtin_unreachable();
244 __builtin_unreachable();
#define SYSCALL_dmabuf_alloc
#define SYSCALL_vfs_mount
#define SYSCALL_mmap_file
#define SYSCALL_dmabuf_share
#define SYSCALL_vfs_fsync
#define SYSCALL_fd_manipulate
#define SYSCALL_yield_cpu
#define SYSCALL_vm_protect
#define SYSCALL_signal_register
#define SYSCALL_vfs_unlinkat
#define SYSCALL_ipc_accept
#define SYSCALL_wait_for_thread
#define SYSCALL_wait_for_process
#define SYSCALL_vfs_readlinkat
#define SYSCALL_thread_getname
#define SYSCALL_memfd_create
#define SYSCALL_futex_wake
#define SYSCALL_arch_syscall
#define SYSCALL_signal_thread
#define SYSCALL_clock_msleep
#define SYSCALL_dmabuf_unshare
#define SYSCALL_vfs_unmount
#define SYSCALL_ipc_connect
#define SYSCALL_vfs_fstatat
#define SYSCALL_thread_exit
#define SYSCALL_thread_setname
#define SYSCALL_mmap_anonymous
#define SYSCALL_signal_mask_op
#define SYSCALL_signal_process
#define SYSCALL_vfs_list_dir
#define SYSCALL_futex_wait
#define SYSCALL_clock_gettimeofday
#define SYSCALL_vfs_fchmodat
#define SYSCALL_io_pselect
#define SYSCALL_dmabuf_free
#define SYSCALL_create_thread
#define SYSCALL_vfs_openat
#define SYSCALL_vfs_mkdir
#define SYSCALL_ipc_create
#define SYSCALL_vfs_getcwd
#define SYSCALL_vfs_chdirat
#define SYSCALL_get_parent_pid
#define SYSCALL_signal_return
#define SYSCALL_vfs_symlink
void(* thread_entry_t)(void *arg)
should_inline fd_t syscall_ipc_create(const char *name, size_t max_pending_connections)
should_inline void syscall_yield_cpu(void)
should_inline bool syscall_dmabuf_share(void *buf, size_t bufsize, ptr_t *out_paddr)
should_inline ssize_t syscall_io_readv(fd_t fd, const struct iovec *iov, int iov_count)
should_inline __attribute__((__noreturn__)) void syscall_exit(u32 exit_code)
should_inline long syscall_vfs_unlinkat(fd_t dirfd, const char *path)
should_inline void syscall_poweroff(bool reboot, u32 magic)
should_inline long syscall_fd_manipulate(fd_t fd, u64 cmd, void *arg)
should_inline fd_t syscall_ipc_connect(const char *name, size_t buffer_size)
should_inline u64 syscall_arch_syscall(u64 nr, u64 arg1, u64 arg2, u64 arg3, u64 arg4)
should_inline long syscall_clock_msleep(u64 ms)
should_inline long syscall_vfs_fsync(fd_t fd, bool data_only)
should_inline pid_t syscall_get_parent_pid(void)
should_inline pid_t syscall_get_pid(void)
should_inline bool syscall_dmabuf_alloc(size_t n_pages, ptr_t *out_paddr, ptr_t *out_vaddr)
should_inline long syscall_vfs_chdirat(fd_t dirfd, const char *path)
should_inline long syscall_io_pread(fd_t fd, void *buf, size_t count, off_t offset)
should_inline tid_t syscall_create_thread(const char *name, thread_entry_t entry, void *arg, size_t stack_size, void *stack)
should_inline bool syscall_io_close(fd_t fd)
should_inline off_t syscall_io_tell(fd_t fd)
should_inline bool syscall_dmabuf_unshare(ptr_t paddr, size_t size, void *vaddr)
should_inline pid_t syscall_spawn(const char *file_path, const char *const *argv, const char *const *envp)
should_inline long syscall_vfs_symlink(const char *link_path, const char *target)
should_inline long syscall_execveat(fd_t dirfd, const char *file_path, const char *const *argv, const char *const *envp, u32 flags)
should_inline size_t syscall_io_read(fd_t fd, void *buffer, size_t size)
should_inline long syscall_vfs_mkdir(const char *path)
should_inline bool syscall_dmabuf_free(ptr_t vaddr, ptr_t paddr)
should_inline int syscall_io_poll(struct pollfd *fds, nfds_t nfds, int timeout)
should_inline tid_t syscall_get_tid(void)
should_inline fd_t syscall_io_dup(fd_t fd)
should_inline bool syscall_futex_wait(futex_word_t *futex, u32 val)
should_inline long syscall_signal_mask_op(int how, const sigset_t *set, sigset_t *oldset)
should_inline bool syscall_futex_wake(futex_word_t *futex, size_t count)
should_inline pid_t syscall_fork(void)
should_inline long syscall_vfs_fstatat(fd_t dirfd, const char *file_path, file_stat_t *stat_buf, fstatat_flags flags)
should_inline bool syscall_signal_register(signal_t signum, const sigaction_t *action)
should_inline void * syscall_mmap_anonymous(ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags)
should_inline long syscall_pipe(fd_t *out_read_fd, fd_t *out_write_fd, fd_flags_t flags)
should_inline long syscall_signal_process(pid_t pid, signal_t signum)
should_inline pid_t syscall_wait_for_process(pid_t pid, u32 *exit_code, u32 flags)
should_inline long syscall_clock_gettimeofday(struct timespec *tv)
should_inline fd_t syscall_vfs_openat(fd_t dirfd, const char *file_path, open_flags flags)
should_inline fd_t syscall_ipc_accept(fd_t fd)
should_inline void * syscall_mmap_file(ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags, fd_t fd, off_t offset)
should_inline fd_t syscall_io_dup2(fd_t old_fd, fd_t new_fd)
should_inline long syscall_signal_thread(tid_t tid, signal_t signum)
should_inline bool syscall_vm_protect(void *addr, size_t size, mem_perm_t perm)
should_inline long syscall_vfs_unmount(const char *mount_point)
should_inline size_t syscall_vfs_list_dir(fd_t fd, char *buffer, size_t buffer_size)
should_inline bool syscall_wait_for_thread(tid_t tid)
should_inline off_t syscall_io_seek(fd_t fd, off_t offset, io_seek_whence_t whence)
should_inline ssize_t syscall_vfs_readlinkat(fd_t dirfd, const char *path, char *buf, size_t buf_size)
should_inline ssize_t syscall_thread_getname(tid_t tid, char *buf, size_t buf_size)
should_inline long syscall_thread_setname(tid_t tid, const char *name)
should_inline long syscall_vfs_mount(const char *device, const char *mount_point, const char *fs_type, const char *options)
should_inline int syscall_io_pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask)
should_inline fd_t syscall_memfd_create(const char *name, u32 flags)
should_inline size_t syscall_io_write(fd_t fd, const void *buffer, size_t size)
should_inline ssize_t syscall_vfs_getcwd(char *buf, size_t buf_size)
should_inline bool syscall_munmap(void *addr, size_t size)
should_inline long syscall_vfs_fchmodat(fd_t dirfd, const char *path, int mode, int flags)