MOS Source Code
Loading...
Searching...
No Matches
decl.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2// Kernel syscall declarations
3// This file was generated by scripts/gen_syscall.py
4
5#pragma once
6
8#include <mos/io/io_types.h>
9#include <mos/mos_global.h>
11#include <mos/types.h>
12#include <sys/poll.h>
13#include <sys/select.h>
14#include <sys/uio.h>
15
16fd_t impl_syscall_vfs_openat(fd_t dirfd, const char *file_path, open_flags flags);
17
18long impl_syscall_vfs_fstatat(fd_t dirfd, const char *file_path, file_stat_t *stat_buf, fstatat_flags flags);
19
20size_t impl_syscall_io_read(fd_t fd, void *buffer, size_t size);
21
22size_t impl_syscall_io_write(fd_t fd, const void *buffer, size_t size);
23
25
26__attribute__((__noreturn__)) void impl_syscall_exit(u32 exit_code);
27
29
31
33
35
36pid_t impl_syscall_spawn(const char *file_path, const char *const *argv, const char *const *envp);
37
38tid_t impl_syscall_create_thread(const char *name, thread_entry_t entry, void *arg, size_t stack_size, void *stack);
39
41
42__attribute__((__noreturn__)) void impl_syscall_thread_exit(void);
43
45
47
48bool impl_syscall_futex_wake(futex_word_t *futex, size_t count);
49
50fd_t impl_syscall_ipc_create(const char *name, size_t max_pending_connections);
51
53
54fd_t impl_syscall_ipc_connect(const char *name, size_t buffer_size);
55
56u64 impl_syscall_arch_syscall(u64 nr, u64 arg1, u64 arg2, u64 arg3, u64 arg4);
57
58long impl_syscall_vfs_mount(const char *device, const char *mount_point, const char *fs_type, const char *options);
59
60ssize_t impl_syscall_vfs_readlinkat(fd_t dirfd, const char *path, char *buf, size_t buf_size);
61
62long impl_syscall_vfs_unlinkat(fd_t dirfd, const char *path);
63
64long impl_syscall_vfs_symlink(const char *link_path, const char *target);
65
66long impl_syscall_vfs_mkdir(const char *path);
67
68size_t impl_syscall_vfs_list_dir(fd_t fd, char *buffer, size_t buffer_size);
69
70long impl_syscall_fd_manipulate(fd_t fd, u64 cmd, void *arg);
71
72void *impl_syscall_mmap_anonymous(ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags);
73
74void *impl_syscall_mmap_file(ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags, fd_t fd, off_t offset);
75
77
78bool impl_syscall_munmap(void *addr, size_t size);
79
80long impl_syscall_vfs_chdirat(fd_t dirfd, const char *path);
81
82ssize_t impl_syscall_vfs_getcwd(char *buf, size_t buf_size);
83
85
87
89
91
93
94void impl_syscall_poweroff(bool reboot, u32 magic);
95
96__attribute__((__noreturn__)) void impl_syscall_signal_return(void *sp);
97
98bool impl_syscall_vm_protect(void *addr, size_t size, mem_perm_t perm);
99
100int impl_syscall_io_poll(struct pollfd *fds, nfds_t nfds, int timeout);
101
102int impl_syscall_io_pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask);
103
104long impl_syscall_execveat(fd_t dirfd, const char *file_path, const char *const *argv, const char *const *envp, u32 flags);
105
107
109
111
112bool impl_syscall_dmabuf_alloc(size_t n_pages, ptr_t *out_paddr, ptr_t *out_vaddr);
113
115
116bool impl_syscall_dmabuf_share(void *buf, size_t bufsize, ptr_t *out_paddr);
117
118bool impl_syscall_dmabuf_unshare(ptr_t paddr, size_t size, void *vaddr);
119
120long impl_syscall_pipe(fd_t *out_read_fd, fd_t *out_write_fd, fd_flags_t flags);
121
122ssize_t impl_syscall_io_readv(fd_t fd, const struct iovec *iov, int iov_count);
123
124long impl_syscall_vfs_unmount(const char *mount_point);
125
126long impl_syscall_clock_gettimeofday(struct timespec *tv);
127
129
130ssize_t impl_syscall_thread_getname(tid_t tid, char *buf, size_t buf_size);
131
132long impl_syscall_vfs_fchmodat(fd_t dirfd, const char *path, int mode, int flags);
133
134long impl_syscall_io_pread(fd_t fd, void *buf, size_t count, off_t offset);
135
137
138long impl_syscall_signal_mask_op(int how, const sigset_t *set, sigset_t *oldset);
139
140long impl_syscall_vfs_fsync(fd_t fd, bool data_only);
141
142#define define_syscall(name) impl_syscall_##name
fd_t impl_syscall_ipc_connect(const char *name, size_t buffer_size)
bool impl_syscall_wait_for_thread(tid_t tid)
long impl_syscall_io_pread(fd_t fd, void *buf, size_t count, off_t offset)
size_t impl_syscall_io_read(fd_t fd, void *buffer, size_t size)
void * impl_syscall_mmap_anonymous(ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags)
long impl_syscall_clock_gettimeofday(struct timespec *tv)
pid_t impl_syscall_get_parent_pid(void)
off_t impl_syscall_io_seek(fd_t fd, off_t offset, io_seek_whence_t whence)
bool impl_syscall_munmap(void *addr, size_t size)
void * impl_syscall_mmap_file(ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags, fd_t fd, off_t offset)
fd_t impl_syscall_memfd_create(const char *name, u32 flags)
long impl_syscall_vfs_fsync(fd_t fd, bool data_only)
bool impl_syscall_dmabuf_free(ptr_t vaddr, ptr_t paddr)
size_t impl_syscall_vfs_list_dir(fd_t fd, char *buffer, size_t buffer_size)
bool impl_syscall_dmabuf_unshare(ptr_t paddr, size_t size, void *vaddr)
bool impl_syscall_signal_register(signal_t signum, const sigaction_t *action)
pid_t impl_syscall_fork(void)
pid_t impl_syscall_wait_for_process(pid_t pid, u32 *exit_code, u32 flags)
off_t impl_syscall_io_tell(fd_t fd)
long impl_syscall_vfs_chdirat(fd_t dirfd, const char *path)
fd_t impl_syscall_io_dup(fd_t fd)
int impl_syscall_io_poll(struct pollfd *fds, nfds_t nfds, int timeout)
pid_t impl_syscall_get_pid(void)
long impl_syscall_clock_msleep(u64 ms)
u64 impl_syscall_arch_syscall(u64 nr, u64 arg1, u64 arg2, u64 arg3, u64 arg4)
bool impl_syscall_vm_protect(void *addr, size_t size, mem_perm_t perm)
tid_t impl_syscall_get_tid(void)
long impl_syscall_vfs_mount(const char *device, const char *mount_point, const char *fs_type, const char *options)
long impl_syscall_vfs_mkdir(const char *path)
long impl_syscall_vfs_unmount(const char *mount_point)
long impl_syscall_vfs_fchmodat(fd_t dirfd, const char *path, int mode, int flags)
long impl_syscall_thread_setname(tid_t tid, const char *name)
size_t impl_syscall_io_write(fd_t fd, const void *buffer, size_t size)
pid_t impl_syscall_spawn(const char *file_path, const char *const *argv, const char *const *envp)
fd_t impl_syscall_io_dup2(fd_t old_fd, fd_t new_fd)
long impl_syscall_signal_mask_op(int how, const sigset_t *set, sigset_t *oldset)
ssize_t impl_syscall_thread_getname(tid_t tid, char *buf, size_t buf_size)
long impl_syscall_execveat(fd_t dirfd, const char *file_path, const char *const *argv, const char *const *envp, u32 flags)
fd_t impl_syscall_vfs_openat(fd_t dirfd, const char *file_path, open_flags flags)
long impl_syscall_fd_manipulate(fd_t fd, u64 cmd, void *arg)
bool impl_syscall_io_close(fd_t fd)
long impl_syscall_vfs_symlink(const char *link_path, const char *target)
void impl_syscall_poweroff(bool reboot, u32 magic)
__attribute__((__noreturn__)) void impl_syscall_exit(u32 exit_code)
Definition usermode.h:90
int impl_syscall_io_pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask)
bool impl_syscall_futex_wait(futex_word_t *futex, u32 val)
long impl_syscall_vfs_fstatat(fd_t dirfd, const char *file_path, file_stat_t *stat_buf, fstatat_flags flags)
long impl_syscall_vfs_unlinkat(fd_t dirfd, const char *path)
bool impl_syscall_futex_wake(futex_word_t *futex, size_t count)
bool impl_syscall_dmabuf_alloc(size_t n_pages, ptr_t *out_paddr, ptr_t *out_vaddr)
long impl_syscall_pipe(fd_t *out_read_fd, fd_t *out_write_fd, fd_flags_t flags)
void impl_syscall_yield_cpu(void)
long impl_syscall_signal_process(pid_t pid, signal_t signum)
fd_t impl_syscall_ipc_accept(fd_t fd)
ssize_t impl_syscall_io_readv(fd_t fd, const struct iovec *iov, int iov_count)
ssize_t impl_syscall_vfs_readlinkat(fd_t dirfd, const char *path, char *buf, size_t buf_size)
tid_t impl_syscall_create_thread(const char *name, thread_entry_t entry, void *arg, size_t stack_size, void *stack)
long impl_syscall_signal_thread(tid_t tid, signal_t signum)
bool impl_syscall_dmabuf_share(void *buf, size_t bufsize, ptr_t *out_paddr)
fd_t impl_syscall_ipc_create(const char *name, size_t max_pending_connections)
ssize_t impl_syscall_vfs_getcwd(char *buf, size_t buf_size)
fstatat_flags
Definition fs_types.h:40
fd_flags_t
Definition fs_types.h:47
open_flags
Definition fs_types.h:26
io_seek_whence_t
Definition io_types.h:6
const char ** argv
Definition kmain.c:44
mem_perm_t
Definition mm_types.h:7
mmap_flags_t
Definition mm_types.h:15
int signal_t
Definition signal_types.h:9
size_t size
Definition slab.c:30
const char * name
Definition slab.c:31
static char buffer[2048]
Definition test_printf.c:7
unsigned int u32
Definition types.h:21
s32 futex_word_t
Definition types.h:99
ssize_t off_t
Definition types.h:84
void(* thread_entry_t)(void *arg)
Definition types.h:109
s32 fd_t
Definition types.h:81
s32 tid_t
Definition types.h:79
s32 pid_t
Definition types.h:78
unsigned long ptr_t
Definition types.h:25
unsigned long long u64
Definition types.h:23
signed long ssize_t
Definition types.h:83