MOS Source Code
Loading...
Searching...
No Matches
decl.h File Reference
#include <mos/filesystem/fs_types.h>
#include <mos/io/io_types.h>
#include <mos/mos_global.h>
#include <mos/tasks/signal_types.h>
#include <mos/types.h>
#include <sys/poll.h>
#include <sys/select.h>
#include <sys/uio.h>
+ Include dependency graph for decl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define define_syscall(name)
 

Functions

fd_t impl_syscall_vfs_openat (fd_t dirfd, const char *file_path, open_flags flags)
 
long impl_syscall_vfs_fstatat (fd_t dirfd, const char *file_path, file_stat_t *stat_buf, fstatat_flags flags)
 
size_t impl_syscall_io_read (fd_t fd, void *buffer, size_t size)
 
size_t impl_syscall_io_write (fd_t fd, const void *buffer, size_t size)
 
bool impl_syscall_io_close (fd_t fd)
 
 __attribute__ ((__noreturn__)) void impl_syscall_exit(u32 exit_code)
 
void impl_syscall_yield_cpu (void)
 
pid_t impl_syscall_fork (void)
 
pid_t impl_syscall_get_pid (void)
 
pid_t impl_syscall_get_parent_pid (void)
 
pid_t impl_syscall_spawn (const char *file_path, const char *const *argv, const char *const *envp)
 
tid_t impl_syscall_create_thread (const char *name, thread_entry_t entry, void *arg, size_t stack_size, void *stack)
 
tid_t impl_syscall_get_tid (void)
 
bool impl_syscall_wait_for_thread (tid_t tid)
 
bool impl_syscall_futex_wait (futex_word_t *futex, u32 val)
 
bool impl_syscall_futex_wake (futex_word_t *futex, size_t count)
 
fd_t impl_syscall_ipc_create (const char *name, size_t max_pending_connections)
 
fd_t impl_syscall_ipc_accept (fd_t fd)
 
fd_t impl_syscall_ipc_connect (const char *name, size_t buffer_size)
 
u64 impl_syscall_arch_syscall (u64 nr, u64 arg1, u64 arg2, u64 arg3, u64 arg4)
 
long impl_syscall_vfs_mount (const char *device, const char *mount_point, const char *fs_type, const char *options)
 
ssize_t impl_syscall_vfs_readlinkat (fd_t dirfd, const char *path, char *buf, size_t buf_size)
 
long impl_syscall_vfs_unlinkat (fd_t dirfd, const char *path)
 
long impl_syscall_vfs_symlink (const char *link_path, const char *target)
 
long impl_syscall_vfs_mkdir (const char *path)
 
size_t impl_syscall_vfs_list_dir (fd_t fd, char *buffer, size_t buffer_size)
 
long impl_syscall_fd_manipulate (fd_t fd, u64 cmd, void *arg)
 
voidimpl_syscall_mmap_anonymous (ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags)
 
voidimpl_syscall_mmap_file (ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags, fd_t fd, off_t offset)
 
pid_t impl_syscall_wait_for_process (pid_t pid, u32 *exit_code, u32 flags)
 
bool impl_syscall_munmap (void *addr, size_t size)
 
long impl_syscall_vfs_chdirat (fd_t dirfd, const char *path)
 
ssize_t impl_syscall_vfs_getcwd (char *buf, size_t buf_size)
 
off_t impl_syscall_io_seek (fd_t fd, off_t offset, io_seek_whence_t whence)
 
off_t impl_syscall_io_tell (fd_t fd)
 
bool impl_syscall_signal_register (signal_t signum, const sigaction_t *action)
 
long impl_syscall_signal_process (pid_t pid, signal_t signum)
 
long impl_syscall_signal_thread (tid_t tid, signal_t signum)
 
void impl_syscall_poweroff (bool reboot, u32 magic)
 
bool impl_syscall_vm_protect (void *addr, size_t size, mem_perm_t perm)
 
int impl_syscall_io_poll (struct pollfd *fds, nfds_t nfds, int timeout)
 
int impl_syscall_io_pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask)
 
long impl_syscall_execveat (fd_t dirfd, const char *file_path, const char *const *argv, const char *const *envp, u32 flags)
 
long impl_syscall_clock_msleep (u64 ms)
 
fd_t impl_syscall_io_dup (fd_t fd)
 
fd_t impl_syscall_io_dup2 (fd_t old_fd, fd_t new_fd)
 
bool impl_syscall_dmabuf_alloc (size_t n_pages, ptr_t *out_paddr, ptr_t *out_vaddr)
 
bool impl_syscall_dmabuf_free (ptr_t vaddr, ptr_t paddr)
 
bool impl_syscall_dmabuf_share (void *buf, size_t bufsize, ptr_t *out_paddr)
 
bool impl_syscall_dmabuf_unshare (ptr_t paddr, size_t size, void *vaddr)
 
long impl_syscall_pipe (fd_t *out_read_fd, fd_t *out_write_fd, fd_flags_t flags)
 
ssize_t impl_syscall_io_readv (fd_t fd, const struct iovec *iov, int iov_count)
 
long impl_syscall_vfs_unmount (const char *mount_point)
 
long impl_syscall_clock_gettimeofday (struct timespec *tv)
 
long impl_syscall_thread_setname (tid_t tid, const char *name)
 
ssize_t impl_syscall_thread_getname (tid_t tid, char *buf, size_t buf_size)
 
long impl_syscall_vfs_fchmodat (fd_t dirfd, const char *path, int mode, int flags)
 
long impl_syscall_io_pread (fd_t fd, void *buf, size_t count, off_t offset)
 
fd_t impl_syscall_memfd_create (const char *name, u32 flags)
 
long impl_syscall_signal_mask_op (int how, const sigset_t *set, sigset_t *oldset)
 
long impl_syscall_vfs_fsync (fd_t fd, bool data_only)
 

Macro Definition Documentation

◆ define_syscall

#define define_syscall ( name)
Value:
impl_syscall_##name
const char * name
Definition slab.c:31

Definition at line 142 of file decl.h.

Function Documentation

◆ impl_syscall_vfs_openat()

fd_t impl_syscall_vfs_openat ( fd_t dirfd,
const char * file_path,
open_flags flags )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_fstatat()

long impl_syscall_vfs_fstatat ( fd_t dirfd,
const char * file_path,
file_stat_t * stat_buf,
fstatat_flags flags )

Referenced by dispatch_syscall().

◆ impl_syscall_io_read()

size_t impl_syscall_io_read ( fd_t fd,
void * buffer,
size_t size )

Referenced by dispatch_syscall().

◆ impl_syscall_io_write()

size_t impl_syscall_io_write ( fd_t fd,
const void * buffer,
size_t size )

Referenced by dispatch_syscall().

◆ impl_syscall_io_close()

bool impl_syscall_io_close ( fd_t fd)

Referenced by dispatch_syscall().

◆ __attribute__()

should_inline __attribute__ ( (__noreturn__) )

Definition at line 90 of file usermode.h.

+ Here is the call graph for this function:

◆ impl_syscall_yield_cpu()

void impl_syscall_yield_cpu ( void )

Referenced by dispatch_syscall().

◆ impl_syscall_fork()

pid_t impl_syscall_fork ( void )

Referenced by dispatch_syscall().

◆ impl_syscall_get_pid()

pid_t impl_syscall_get_pid ( void )

Referenced by dispatch_syscall().

◆ impl_syscall_get_parent_pid()

pid_t impl_syscall_get_parent_pid ( void )

Referenced by dispatch_syscall().

◆ impl_syscall_spawn()

pid_t impl_syscall_spawn ( const char * file_path,
const char *const * argv,
const char *const * envp )

Referenced by dispatch_syscall().

◆ impl_syscall_create_thread()

tid_t impl_syscall_create_thread ( const char * name,
thread_entry_t entry,
void * arg,
size_t stack_size,
void * stack )

Referenced by dispatch_syscall().

◆ impl_syscall_get_tid()

tid_t impl_syscall_get_tid ( void )

Referenced by dispatch_syscall().

◆ impl_syscall_wait_for_thread()

bool impl_syscall_wait_for_thread ( tid_t tid)

Referenced by dispatch_syscall().

◆ impl_syscall_futex_wait()

bool impl_syscall_futex_wait ( futex_word_t * futex,
u32 val )

Referenced by dispatch_syscall().

◆ impl_syscall_futex_wake()

bool impl_syscall_futex_wake ( futex_word_t * futex,
size_t count )

Referenced by dispatch_syscall().

◆ impl_syscall_ipc_create()

fd_t impl_syscall_ipc_create ( const char * name,
size_t max_pending_connections )

Referenced by dispatch_syscall().

◆ impl_syscall_ipc_accept()

fd_t impl_syscall_ipc_accept ( fd_t fd)

Referenced by dispatch_syscall().

◆ impl_syscall_ipc_connect()

fd_t impl_syscall_ipc_connect ( const char * name,
size_t buffer_size )

Referenced by dispatch_syscall().

◆ impl_syscall_arch_syscall()

u64 impl_syscall_arch_syscall ( u64 nr,
u64 arg1,
u64 arg2,
u64 arg3,
u64 arg4 )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_mount()

long impl_syscall_vfs_mount ( const char * device,
const char * mount_point,
const char * fs_type,
const char * options )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_readlinkat()

ssize_t impl_syscall_vfs_readlinkat ( fd_t dirfd,
const char * path,
char * buf,
size_t buf_size )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_unlinkat()

long impl_syscall_vfs_unlinkat ( fd_t dirfd,
const char * path )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_symlink()

long impl_syscall_vfs_symlink ( const char * link_path,
const char * target )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_mkdir()

long impl_syscall_vfs_mkdir ( const char * path)

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_list_dir()

size_t impl_syscall_vfs_list_dir ( fd_t fd,
char * buffer,
size_t buffer_size )

Referenced by dispatch_syscall().

◆ impl_syscall_fd_manipulate()

long impl_syscall_fd_manipulate ( fd_t fd,
u64 cmd,
void * arg )

Referenced by dispatch_syscall().

◆ impl_syscall_mmap_anonymous()

void * impl_syscall_mmap_anonymous ( ptr_t hint_addr,
size_t size,
mem_perm_t perm,
mmap_flags_t flags )

Referenced by dispatch_syscall().

◆ impl_syscall_mmap_file()

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 )

Referenced by dispatch_syscall().

◆ impl_syscall_wait_for_process()

pid_t impl_syscall_wait_for_process ( pid_t pid,
u32 * exit_code,
u32 flags )

Referenced by dispatch_syscall().

◆ impl_syscall_munmap()

bool impl_syscall_munmap ( void * addr,
size_t size )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_chdirat()

long impl_syscall_vfs_chdirat ( fd_t dirfd,
const char * path )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_getcwd()

ssize_t impl_syscall_vfs_getcwd ( char * buf,
size_t buf_size )

Referenced by dispatch_syscall().

◆ impl_syscall_io_seek()

off_t impl_syscall_io_seek ( fd_t fd,
off_t offset,
io_seek_whence_t whence )

Referenced by dispatch_syscall().

◆ impl_syscall_io_tell()

off_t impl_syscall_io_tell ( fd_t fd)

Referenced by dispatch_syscall().

◆ impl_syscall_signal_register()

bool impl_syscall_signal_register ( signal_t signum,
const sigaction_t * action )

Referenced by dispatch_syscall().

◆ impl_syscall_signal_process()

long impl_syscall_signal_process ( pid_t pid,
signal_t signum )

Referenced by dispatch_syscall().

◆ impl_syscall_signal_thread()

long impl_syscall_signal_thread ( tid_t tid,
signal_t signum )

Referenced by dispatch_syscall().

◆ impl_syscall_poweroff()

void impl_syscall_poweroff ( bool reboot,
u32 magic )

Referenced by dispatch_syscall().

◆ impl_syscall_vm_protect()

bool impl_syscall_vm_protect ( void * addr,
size_t size,
mem_perm_t perm )

Referenced by dispatch_syscall().

◆ impl_syscall_io_poll()

int impl_syscall_io_poll ( struct pollfd * fds,
nfds_t nfds,
int timeout )

Referenced by dispatch_syscall().

◆ impl_syscall_io_pselect()

int impl_syscall_io_pselect ( int nfds,
fd_set * readfds,
fd_set * writefds,
fd_set * exceptfds,
const struct timespec * timeout,
const sigset_t * sigmask )

Referenced by dispatch_syscall().

◆ impl_syscall_execveat()

long impl_syscall_execveat ( fd_t dirfd,
const char * file_path,
const char *const * argv,
const char *const * envp,
u32 flags )

Referenced by dispatch_syscall().

◆ impl_syscall_clock_msleep()

long impl_syscall_clock_msleep ( u64 ms)

Referenced by dispatch_syscall().

◆ impl_syscall_io_dup()

fd_t impl_syscall_io_dup ( fd_t fd)

Referenced by dispatch_syscall().

◆ impl_syscall_io_dup2()

fd_t impl_syscall_io_dup2 ( fd_t old_fd,
fd_t new_fd )

Referenced by dispatch_syscall().

◆ impl_syscall_dmabuf_alloc()

bool impl_syscall_dmabuf_alloc ( size_t n_pages,
ptr_t * out_paddr,
ptr_t * out_vaddr )

Referenced by dispatch_syscall().

◆ impl_syscall_dmabuf_free()

bool impl_syscall_dmabuf_free ( ptr_t vaddr,
ptr_t paddr )

Referenced by dispatch_syscall().

◆ impl_syscall_dmabuf_share()

bool impl_syscall_dmabuf_share ( void * buf,
size_t bufsize,
ptr_t * out_paddr )

Referenced by dispatch_syscall().

◆ impl_syscall_dmabuf_unshare()

bool impl_syscall_dmabuf_unshare ( ptr_t paddr,
size_t size,
void * vaddr )

Referenced by dispatch_syscall().

◆ impl_syscall_pipe()

long impl_syscall_pipe ( fd_t * out_read_fd,
fd_t * out_write_fd,
fd_flags_t flags )

Referenced by dispatch_syscall().

◆ impl_syscall_io_readv()

ssize_t impl_syscall_io_readv ( fd_t fd,
const struct iovec * iov,
int iov_count )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_unmount()

long impl_syscall_vfs_unmount ( const char * mount_point)

Referenced by dispatch_syscall().

◆ impl_syscall_clock_gettimeofday()

long impl_syscall_clock_gettimeofday ( struct timespec * tv)

Referenced by dispatch_syscall().

◆ impl_syscall_thread_setname()

long impl_syscall_thread_setname ( tid_t tid,
const char * name )

Referenced by dispatch_syscall().

◆ impl_syscall_thread_getname()

ssize_t impl_syscall_thread_getname ( tid_t tid,
char * buf,
size_t buf_size )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_fchmodat()

long impl_syscall_vfs_fchmodat ( fd_t dirfd,
const char * path,
int mode,
int flags )

Referenced by dispatch_syscall().

◆ impl_syscall_io_pread()

long impl_syscall_io_pread ( fd_t fd,
void * buf,
size_t count,
off_t offset )

Referenced by dispatch_syscall().

◆ impl_syscall_memfd_create()

fd_t impl_syscall_memfd_create ( const char * name,
u32 flags )

Referenced by dispatch_syscall().

◆ impl_syscall_signal_mask_op()

long impl_syscall_signal_mask_op ( int how,
const sigset_t * set,
sigset_t * oldset )

Referenced by dispatch_syscall().

◆ impl_syscall_vfs_fsync()

long impl_syscall_vfs_fsync ( fd_t fd,
bool data_only )

Referenced by dispatch_syscall().