MOS Source Code
Loading...
Searching...
No Matches
ksyscall.c File Reference
#include "mos/device/timer.h"
#include "mos/ipc/ipc_io.h"
#include "mos/ipc/memfd.h"
#include "mos/ipc/pipe.h"
#include "mos/misc/power.h"
#include "mos/mm/dma.h"
#include "mos/tasks/signal.h"
#include <bits/posix/iovec.h>
#include <errno.h>
#include <fcntl.h>
#include <mos/filesystem/fs_types.h>
#include <mos/filesystem/vfs.h>
#include <mos/io/io.h>
#include <mos/locks/futex.h>
#include <mos/mm/mmap.h>
#include <mos/mm/paging/paging.h>
#include <mos/platform/platform.h>
#include <mos/syscall/decl.h>
#include <mos/syscall/number.h>
#include <mos/syslog/printk.h>
#include <mos/tasks/elf.h>
#include <mos/tasks/process.h>
#include <mos/tasks/schedule.h>
#include <mos/tasks/task_types.h>
#include <mos/tasks/thread.h>
#include <mos/types.h>
#include <mos_stdlib.h>
#include <mos_string.h>
#include <sys/poll.h>
+ Include dependency graph for ksyscall.c:

Go to the source code of this file.

Macros

#define DEFINE_SYSCALL(ret, name)
 
#define POWEROFF_MAGIC   MOS_FOURCC('G', 'B', 'y', 'e')
 
#define FD_CLR(__fd, __set)
 
#define FD_ISSET(__fd, __set)
 
#define FD_SET(__fd, __set)
 
#define FD_ZERO(__set)
 

Functions

 MOS_STATIC_ASSERT (SYSCALL_DEFINED(poweroff))
 
void define_syscall poweroff (bool reboot, u32 magic)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_openat))
 
fd_t define_syscall vfs_openat (fd_t dirfd, const char *path, open_flags flags)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_fstatat))
 
long define_syscall vfs_fstatat (fd_t fd, const char *path, file_stat_t *stat_buf, fstatat_flags flags)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_read))
 
size_t define_syscall io_read (fd_t fd, void *buf, size_t count)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_write))
 
size_t define_syscall io_write (fd_t fd, const void *buf, size_t count)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_close))
 
bool define_syscall io_close (fd_t fd)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(exit))
 
void define_syscall exit (u32 exit_code)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(yield_cpu))
 
void define_syscall yield_cpu (void)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(fork))
 
pid_t define_syscall fork (void)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(get_pid))
 
pid_t define_syscall get_pid (void)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(get_parent_pid))
 
pid_t define_syscall get_parent_pid (void)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(spawn))
 
pid_t define_syscall spawn (const char *path, const char *const argv[], const char *const envp[])
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(create_thread))
 
tid_t define_syscall create_thread (const char *name, thread_entry_t entry, void *arg, size_t stack_size, void *stack)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(get_tid))
 
tid_t define_syscall get_tid (void)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(thread_exit))
 
void define_syscall thread_exit (void)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(wait_for_thread))
 
bool define_syscall wait_for_thread (tid_t tid)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(futex_wait))
 
bool define_syscall futex_wait (futex_word_t *futex, u32 val)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(futex_wake))
 
bool define_syscall futex_wake (futex_word_t *futex, size_t count)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(ipc_create))
 
fd_t define_syscall ipc_create (const char *name, size_t max_pending_connections)
 Create a new IPC server.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(ipc_accept))
 
fd_t define_syscall ipc_accept (fd_t listen_fd)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(ipc_connect))
 
fd_t define_syscall ipc_connect (const char *server, size_t buffer_size)
 Connect to an IPC servers.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(arch_syscall))
 
u64 define_syscall arch_syscall (u64 syscall, u64 arg1, u64 arg2, u64 arg3, u64 arg4)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_mount))
 
long define_syscall vfs_mount (const char *device, const char *mountpoint, const char *fs_type, const char *options)
 Mount a filesystem at a given existing path.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_readlinkat))
 
ssize_t define_syscall vfs_readlinkat (fd_t dirfd, const char *path, char *buf, size_t buflen)
 Read a symbolic link.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_unlinkat))
 
long define_syscall vfs_unlinkat (fd_t dirfd, const char *path)
 Remove the name of a file, and possibly the file itself.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_symlink))
 
long define_syscall vfs_symlink (const char *target, const char *linkpath)
 Create a symbolic link.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_mkdir))
 
long define_syscall vfs_mkdir (const char *path)
 Create a directory.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_list_dir))
 
size_t define_syscall vfs_list_dir (fd_t fd, char *buffer, size_t buffer_size)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(fd_manipulate))
 
long define_syscall fd_manipulate (fd_t fd, u64 op, void *arg)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(mmap_anonymous))
 
void *define_syscall mmap_anonymous (ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t flags)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(mmap_file))
 
void *define_syscall mmap_file (ptr_t hint_addr, size_t size, mem_perm_t perm, mmap_flags_t mmap_flags, fd_t fd, off_t offset)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(wait_for_process))
 
pid_t define_syscall wait_for_process (pid_t pid, u32 *exit_code, u32 flags)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(munmap))
 
bool define_syscall munmap (void *addr, size_t size)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_chdirat))
 
long define_syscall vfs_chdirat (fd_t dirfd, const char *path)
 Change the current working directory.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_getcwd))
 
ssize_t define_syscall vfs_getcwd (char *buf, size_t size)
 Get the current working directory.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_seek))
 
off_t define_syscall io_seek (fd_t fd, off_t offset, io_seek_whence_t whence)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_tell))
 
off_t define_syscall io_tell (fd_t fd)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(signal_register))
 
bool define_syscall signal_register (signal_t sig, const sigaction_t *action)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(signal_process))
 
long define_syscall signal_process (pid_t pid, signal_t sig)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(signal_thread))
 
long define_syscall signal_thread (tid_t tid, signal_t sig)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(signal_return))
 
void define_syscall signal_return (void *sp)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vm_protect))
 
bool define_syscall vm_protect (void *addr, size_t size, mem_perm_t perm)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_poll))
 
int define_syscall io_poll (struct pollfd *fds, nfds_t nfds, int timeout)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_pselect))
 
int define_syscall io_pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, const struct timespec *timeout, const sigset_t *sigmask)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(execveat))
 
long define_syscall execveat (fd_t dirfd, const char *path, const char *const argv[], const char *const envp[], u32 flags)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(clock_msleep))
 
long define_syscall clock_msleep (u64 ms)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_dup))
 
fd_t define_syscall io_dup (fd_t fd)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_dup2))
 
fd_t define_syscall io_dup2 (fd_t oldfd, fd_t newfd)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(dmabuf_alloc))
 
bool define_syscall dmabuf_alloc (size_t n_pages, ptr_t *phys, ptr_t *virt)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(dmabuf_free))
 
bool define_syscall dmabuf_free (ptr_t vaddr, ptr_t paddr)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(dmabuf_share))
 
bool define_syscall dmabuf_share (void *buffer, size_t size, ptr_t *phyaddr)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(dmabuf_unshare))
 
bool define_syscall dmabuf_unshare (ptr_t phys, size_t size, void *buf)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(pipe))
 
long define_syscall pipe (fd_t *reader, fd_t *writer, fd_flags_t flags)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_readv))
 
ssize_t define_syscall io_readv (fd_t fd, const struct iovec *iov, int iovcnt)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_unmount))
 
long define_syscall vfs_unmount (const char *path)
 Unmount a filesystem at a given path.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(clock_gettimeofday))
 
long define_syscall clock_gettimeofday (struct timespec *ts)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(thread_setname))
 
long define_syscall thread_setname (tid_t tid, const char *name)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(thread_getname))
 
ssize_t define_syscall thread_getname (tid_t tid, char *buf, size_t buflen)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_fchmodat))
 
long define_syscall vfs_fchmodat (fd_t dirfd, const char *path, int mode, int flags)
 Change the permissions of a file.
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(io_pread))
 
long define_syscall io_pread (fd_t fd, void *buf, size_t count, off_t offset)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(memfd_create))
 
fd_t define_syscall memfd_create (const char *name, u32 flags)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(signal_mask_op))
 
long define_syscall signal_mask_op (int how, const sigset_t *set, sigset_t *oldset)
 
 MOS_STATIC_ASSERT (SYSCALL_DEFINED(vfs_fsync))
 
long define_syscall vfs_fsync (fd_t fd, bool data_only)
 

Macro Definition Documentation

◆ DEFINE_SYSCALL

#define DEFINE_SYSCALL ( ret,
name )
Value:
#define define_syscall(name)
Definition decl.h:142
#define MOS_STATIC_ASSERT
Definition mos_global.h:14
#define SYSCALL_DEFINED(name)
Definition number.h:8
const char * name
Definition slab.c:31

Definition at line 34 of file ksyscall.c.

◆ POWEROFF_MAGIC

#define POWEROFF_MAGIC   MOS_FOURCC('G', 'B', 'y', 'e')

Referenced by MOS_STATIC_ASSERT().

◆ FD_CLR

#define FD_CLR ( __fd,
__set )
Value:
(__set->fds_bits[__fd / 8] &= ~(1 << (__fd % 8)))

Definition at line 426 of file ksyscall.c.

◆ FD_ISSET

#define FD_ISSET ( __fd,
__set )
Value:
(__set->fds_bits[__fd / 8] & (1 << (__fd % 8)))

Definition at line 430 of file ksyscall.c.

Referenced by io_pselect(), and stdin_can_read().

◆ FD_SET

#define FD_SET ( __fd,
__set )
Value:
(__set->fds_bits[__fd / 8] |= 1 << (__fd % 8))

Definition at line 434 of file ksyscall.c.

Referenced by stdin_can_read().

◆ FD_ZERO

#define FD_ZERO ( __set)
Value:
memset(__set->fds_bits, 0, sizeof(fd_set))
static void * memset(void *s, int c, size_t n)
Definition pb_syshdr.h:101

Definition at line 438 of file ksyscall.c.

Referenced by stdin_can_read().

Function Documentation

◆ MOS_STATIC_ASSERT() [1/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(poweroff) )
+ Here is the call graph for this function:

◆ poweroff()

void define_syscall poweroff ( bool reboot,
u32 magic )

Definition at line 38 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [2/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_openat) )
+ Here is the call graph for this function:

◆ vfs_openat()

fd_t define_syscall vfs_openat ( fd_t dirfd,
const char * path,
open_flags flags )

Definition at line 58 of file ksyscall.c.

Referenced by MOS_STATIC_ASSERT().

◆ MOS_STATIC_ASSERT() [3/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_fstatat) )
+ Here is the call graph for this function:

◆ vfs_fstatat()

long define_syscall vfs_fstatat ( fd_t fd,
const char * path,
file_stat_t * stat_buf,
fstatat_flags flags )

Definition at line 69 of file ksyscall.c.

Referenced by MOS_STATIC_ASSERT().

◆ MOS_STATIC_ASSERT() [4/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_read) )

◆ io_read()

size_t define_syscall io_read ( fd_t fd,
void * buf,
size_t count )

Definition at line 74 of file ksyscall.c.

Referenced by io_read(), and io_readv().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [5/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_write) )

◆ io_write()

size_t define_syscall io_write ( fd_t fd,
const void * buf,
size_t count )

Definition at line 86 of file ksyscall.c.

Referenced by io_write().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [6/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_close) )

◆ io_close()

bool define_syscall io_close ( fd_t fd)

Definition at line 104 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [7/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(exit) )

◆ exit()

void define_syscall exit ( u32 exit_code)

Definition at line 110 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [8/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(yield_cpu) )
+ Here is the call graph for this function:

◆ yield_cpu()

void define_syscall yield_cpu ( void )

Definition at line 117 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [9/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(fork) )

◆ fork()

Definition at line 123 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [10/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(get_pid) )

◆ get_pid()

pid_t define_syscall get_pid ( void )

Definition at line 132 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [11/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(get_parent_pid) )

◆ get_parent_pid()

pid_t define_syscall get_parent_pid ( void )

Definition at line 137 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [12/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(spawn) )
+ Here is the call graph for this function:

◆ spawn()

pid_t define_syscall spawn ( const char * path,
const char *const argv[],
const char *const envp[] )

Definition at line 142 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [13/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(create_thread) )

◆ create_thread()

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

Definition at line 153 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [14/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(get_tid) )

◆ get_tid()

tid_t define_syscall get_tid ( void )

Definition at line 165 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [15/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(thread_exit) )
+ Here is the call graph for this function:

◆ thread_exit()

void define_syscall thread_exit ( void )

Definition at line 170 of file ksyscall.c.

Referenced by kthread_entry(), MOS_STATIC_ASSERT(), and signal_do_terminate().

◆ MOS_STATIC_ASSERT() [16/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(wait_for_thread) )
+ Here is the call graph for this function:

◆ wait_for_thread()

bool define_syscall wait_for_thread ( tid_t tid)

Definition at line 175 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [17/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(futex_wait) )

◆ futex_wait()

bool define_syscall futex_wait ( futex_word_t * futex,
u32 val )

Definition at line 180 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [18/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(futex_wake) )

◆ futex_wake()

bool define_syscall futex_wake ( futex_word_t * futex,
size_t count )

Definition at line 185 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [19/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(ipc_create) )

◆ ipc_create()

fd_t define_syscall ipc_create ( const char * name,
size_t max_pending_connections )

Create a new IPC server.

Parameters
nameThe name of the server
max_pending_connectionsThe maximum number of pending connections to allow
Returns
A new io_t object that represents the server, or an error code on failure
Note
The io_t returned by this function is only to accept new connections or close the server, reading or writing to it will fail.

Definition at line 190 of file ksyscall.c.

Referenced by ipc_create().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [20/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(ipc_accept) )

◆ ipc_accept()

fd_t define_syscall ipc_accept ( fd_t listen_fd)

Definition at line 198 of file ksyscall.c.

Referenced by ipc_accept().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [21/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(ipc_connect) )

◆ ipc_connect()

fd_t define_syscall ipc_connect ( const char * name,
size_t buffer_size )

Connect to an IPC servers.

Parameters
nameThe name of the server to connect to
buffer_sizeThe size of a shared-memory buffer to use for the connection
Returns
A new io_t object that represents the connection, or an error code on failure

Definition at line 211 of file ksyscall.c.

Referenced by ipc_connect().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [22/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(arch_syscall) )

◆ arch_syscall()

u64 define_syscall arch_syscall ( u64 syscall,
u64 arg1,
u64 arg2,
u64 arg3,
u64 arg4 )

Definition at line 219 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [23/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_mount) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [24/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_readlinkat) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [25/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_unlinkat) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [26/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_symlink) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [27/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_mkdir) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [28/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_list_dir) )
+ Here is the call graph for this function:

◆ vfs_list_dir()

size_t define_syscall vfs_list_dir ( fd_t fd,
char * buffer,
size_t buffer_size )

Definition at line 249 of file ksyscall.c.

Referenced by MOS_STATIC_ASSERT().

◆ MOS_STATIC_ASSERT() [29/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(fd_manipulate) )

◆ fd_manipulate()

long define_syscall fd_manipulate ( fd_t fd,
u64 op,
void * arg )

Definition at line 257 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [30/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(mmap_anonymous) )

◆ mmap_anonymous()

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

Definition at line 316 of file ksyscall.c.

Referenced by mmap_anonymous().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [31/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(mmap_file) )

◆ mmap_file()

void *define_syscall mmap_file ( ptr_t hint_addr,
size_t size,
mem_perm_t perm,
mmap_flags_t mmap_flags,
fd_t fd,
off_t offset )

Definition at line 325 of file ksyscall.c.

Referenced by mmap_file().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [32/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(wait_for_process) )
+ Here is the call graph for this function:

◆ wait_for_process()

pid_t define_syscall wait_for_process ( pid_t pid,
u32 * exit_code,
u32 flags )

Definition at line 338 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [33/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(munmap) )
+ Here is the call graph for this function:

◆ munmap()

bool define_syscall munmap ( void * addr,
size_t size )

Definition at line 343 of file ksyscall.c.

Referenced by MOS_STATIC_ASSERT().

◆ MOS_STATIC_ASSERT() [34/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_chdirat) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [35/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_getcwd) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [36/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_seek) )

◆ io_seek()

off_t define_syscall io_seek ( fd_t fd,
off_t offset,
io_seek_whence_t whence )

Definition at line 358 of file ksyscall.c.

Referenced by io_seek().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [37/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_tell) )

◆ io_tell()

off_t define_syscall io_tell ( fd_t fd)

Definition at line 366 of file ksyscall.c.

Referenced by io_tell().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [38/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(signal_register) )
+ Here is the call graph for this function:

◆ signal_register()

bool define_syscall signal_register ( signal_t sig,
const sigaction_t * action )

Definition at line 374 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [39/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(signal_process) )
+ Here is the call graph for this function:

◆ signal_process()

long define_syscall signal_process ( pid_t pid,
signal_t sig )

Definition at line 379 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [40/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(signal_thread) )
+ Here is the call graph for this function:

◆ signal_thread()

long define_syscall signal_thread ( tid_t tid,
signal_t sig )

Definition at line 387 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [41/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(signal_return) )
+ Here is the call graph for this function:

◆ signal_return()

void define_syscall signal_return ( void * sp)

Definition at line 395 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [42/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vm_protect) )
+ Here is the call graph for this function:

◆ vm_protect()

bool define_syscall vm_protect ( void * addr,
size_t size,
mem_perm_t perm )

Definition at line 400 of file ksyscall.c.

Referenced by MOS_STATIC_ASSERT().

◆ MOS_STATIC_ASSERT() [43/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_poll) )

◆ io_poll()

int define_syscall io_poll ( struct pollfd * fds,
nfds_t nfds,
int timeout )

Definition at line 405 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [44/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_pselect) )

◆ io_pselect()

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

Definition at line 441 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [45/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(execveat) )

◆ execveat()

long define_syscall execveat ( fd_t dirfd,
const char * path,
const char *const argv[],
const char *const envp[],
u32 flags )

Definition at line 465 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [46/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(clock_msleep) )

◆ clock_msleep()

long define_syscall clock_msleep ( u64 ms)

Definition at line 470 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [47/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_dup) )

◆ io_dup()

fd_t define_syscall io_dup ( fd_t fd)

Definition at line 476 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [48/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_dup2) )

◆ io_dup2()

fd_t define_syscall io_dup2 ( fd_t oldfd,
fd_t newfd )

Definition at line 484 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [49/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(dmabuf_alloc) )

◆ dmabuf_alloc()

bool define_syscall dmabuf_alloc ( size_t n_pages,
ptr_t * phys,
ptr_t * virt )

Definition at line 500 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [50/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(dmabuf_free) )

◆ dmabuf_free()

bool define_syscall dmabuf_free ( ptr_t vaddr,
ptr_t paddr )

Definition at line 507 of file ksyscall.c.

Referenced by dmabuf_free().

◆ MOS_STATIC_ASSERT() [51/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(dmabuf_share) )

◆ dmabuf_share()

bool define_syscall dmabuf_share ( void * buffer,
size_t size,
ptr_t * phyaddr )

Definition at line 512 of file ksyscall.c.

Referenced by dmabuf_share().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [52/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(dmabuf_unshare) )

◆ dmabuf_unshare()

bool define_syscall dmabuf_unshare ( ptr_t phys,
size_t size,
void * buf )

Definition at line 523 of file ksyscall.c.

Referenced by dmabuf_unshare().

◆ MOS_STATIC_ASSERT() [53/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(pipe) )
+ Here is the call graph for this function:

◆ pipe()

long define_syscall pipe ( fd_t * reader,
fd_t * writer,
fd_flags_t flags )

◆ MOS_STATIC_ASSERT() [54/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_readv) )

◆ io_readv()

ssize_t define_syscall io_readv ( fd_t fd,
const struct iovec * iov,
int iovcnt )

Definition at line 540 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [55/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_unmount) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [56/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(clock_gettimeofday) )

◆ clock_gettimeofday()

long define_syscall clock_gettimeofday ( struct timespec * ts)

Definition at line 580 of file ksyscall.c.

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [57/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(thread_setname) )
+ Here is the call graph for this function:

◆ thread_setname()

long define_syscall thread_setname ( tid_t tid,
const char * name )

Definition at line 589 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [58/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(thread_getname) )
+ Here is the call graph for this function:

◆ thread_getname()

ssize_t define_syscall thread_getname ( tid_t tid,
char * buf,
size_t buflen )

Definition at line 602 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [59/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_fchmodat) )
+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [60/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(io_pread) )

◆ io_pread()

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

Definition at line 618 of file ksyscall.c.

Referenced by io_pread().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [61/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(memfd_create) )

◆ memfd_create()

fd_t define_syscall memfd_create ( const char * name,
u32 flags )

Definition at line 633 of file ksyscall.c.

Referenced by memfd_create().

+ Here is the call graph for this function:

◆ MOS_STATIC_ASSERT() [62/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(signal_mask_op) )

◆ signal_mask_op()

long define_syscall signal_mask_op ( int how,
const sigset_t * set,
sigset_t * oldset )

Definition at line 642 of file ksyscall.c.

◆ MOS_STATIC_ASSERT() [63/63]

MOS_STATIC_ASSERT ( SYSCALL_DEFINED(vfs_fsync) )
+ Here is the call graph for this function:

◆ vfs_fsync()

long define_syscall vfs_fsync ( fd_t fd,
bool data_only )

Definition at line 675 of file ksyscall.c.

Referenced by MOS_STATIC_ASSERT().