MOS Source Code
Loading...
Searching...
No Matches
dispatcher.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2// Syscall dispatcher
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
16// syscall implementation declarations and syscall numbers
17#include <mos/syscall/decl.h>
18#include <mos/syscall/number.h>
19
20// debugging support
21#include "mos/syslog/printk.h"
22
23should_inline reg_t dispatch_syscall(const reg_t number, reg_t arg1, reg_t arg2, reg_t arg3, reg_t arg4, reg_t arg5, reg_t arg6)
24{
25 MOS_UNUSED(arg1);
26 MOS_UNUSED(arg2);
27 MOS_UNUSED(arg3);
28 MOS_UNUSED(arg4);
29 MOS_UNUSED(arg5);
30 MOS_UNUSED(arg6);
31
32 reg_t ret = -ENOSYS;
33
34 switch (number)
35 {
37 {
38 pr_dinfo2(syscall, "vfs_openat(dirfd=%d, file_path='%s', flags=%x)", (fd_t) arg1, (const char *) arg2, (open_flags) arg3);
39 ret = (reg_t) impl_syscall_vfs_openat((fd_t) arg1, (const char *) arg2, (open_flags) arg3);
40 break;
41 }
43 {
44 pr_dinfo2(syscall, "vfs_fstatat(dirfd=%d, file_path='%s', stat_buf=%p, flags=%x)", (fd_t) arg1, (const char *) arg2, (void *) arg3, (fstatat_flags) arg4);
45 ret = (reg_t) impl_syscall_vfs_fstatat((fd_t) arg1, (const char *) arg2, (file_stat_t *) arg3, (fstatat_flags) arg4);
46 break;
47 }
48 case SYSCALL_io_read:
49 {
50 pr_dinfo2(syscall, "io_read(fd=%d, buffer=%p, size=%zu)", (fd_t) arg1, (void *) arg2, (size_t) arg3);
51 ret = (reg_t) impl_syscall_io_read((fd_t) arg1, (void *) arg2, (size_t) arg3);
52 break;
53 }
55 {
56 pr_dinfo2(syscall, "io_write(fd=%d, buffer=%p, size=%zu)", (fd_t) arg1, (void *) arg2, (size_t) arg3);
57 ret = (reg_t) impl_syscall_io_write((fd_t) arg1, (const void *) arg2, (size_t) arg3);
58 break;
59 }
61 {
62 pr_dinfo2(syscall, "io_close(fd=%d)", (fd_t) arg1);
63 ret = (reg_t) impl_syscall_io_close((fd_t) arg1);
64 break;
65 }
66 case SYSCALL_exit:
67 {
68 pr_dinfo2(syscall, "exit(exit_code=%u)", (u32) arg1);
69 impl_syscall_exit((u32) arg1);
70 break;
71 }
73 {
74 pr_dinfo2(syscall, "yield_cpu()");
76 break;
77 }
78 case SYSCALL_fork:
79 {
80 pr_dinfo2(syscall, "fork()");
81 ret = (reg_t) impl_syscall_fork();
82 break;
83 }
84 case SYSCALL_get_pid:
85 {
86 pr_dinfo2(syscall, "get_pid()");
88 break;
89 }
91 {
92 pr_dinfo2(syscall, "get_parent_pid()");
94 break;
95 }
96 case SYSCALL_spawn:
97 {
98 pr_dinfo2(syscall, "spawn(file_path='%s', argv=%p, envp=%p)", (const char *) arg1, (void *) arg2, (void *) arg3);
99 ret = (reg_t) impl_syscall_spawn((const char *) arg1, (const char *const *) arg2, (const char *const *) arg3);
100 break;
101 }
103 {
104 pr_dinfo2(syscall, "create_thread(name='%s', entry=%p, arg=%p, stack_size=%zu, stack=%p)", (const char *) arg1, (void *) arg2, (void *) arg3, (size_t) arg4, (void *) arg5);
105 ret = (reg_t) impl_syscall_create_thread((const char *) arg1, (thread_entry_t) arg2, (void *) arg3, (size_t) arg4, (void *) arg5);
106 break;
107 }
108 case SYSCALL_get_tid:
109 {
110 pr_dinfo2(syscall, "get_tid()");
111 ret = (reg_t) impl_syscall_get_tid();
112 break;
113 }
115 {
116 pr_dinfo2(syscall, "thread_exit()");
117 impl_syscall_thread_exit();
118 break;
119 }
121 {
122 pr_dinfo2(syscall, "wait_for_thread(tid=%d)", (tid_t) arg1);
124 break;
125 }
127 {
128 pr_dinfo2(syscall, "futex_wait(futex=%p, val=%u)", (void *) arg1, (u32) arg2);
129 ret = (reg_t) impl_syscall_futex_wait((futex_word_t *) arg1, (u32) arg2);
130 break;
131 }
133 {
134 pr_dinfo2(syscall, "futex_wake(futex=%p, count=%zu)", (void *) arg1, (size_t) arg2);
135 ret = (reg_t) impl_syscall_futex_wake((futex_word_t *) arg1, (size_t) arg2);
136 break;
137 }
139 {
140 pr_dinfo2(syscall, "ipc_create(name='%s', max_pending_connections=%zu)", (const char *) arg1, (size_t) arg2);
141 ret = (reg_t) impl_syscall_ipc_create((const char *) arg1, (size_t) arg2);
142 break;
143 }
145 {
146 pr_dinfo2(syscall, "ipc_accept(fd=%d)", (fd_t) arg1);
147 ret = (reg_t) impl_syscall_ipc_accept((fd_t) arg1);
148 break;
149 }
151 {
152 pr_dinfo2(syscall, "ipc_connect(name='%s', buffer_size=%zu)", (const char *) arg1, (size_t) arg2);
153 ret = (reg_t) impl_syscall_ipc_connect((const char *) arg1, (size_t) arg2);
154 break;
155 }
157 {
158 pr_dinfo2(syscall, "arch_syscall(nr=%llu, arg1=%llu, arg2=%llu, arg3=%llu, arg4=%llu)", (u64) arg1, (u64) arg2, (u64) arg3, (u64) arg4, (u64) arg5);
159 ret = (reg_t) impl_syscall_arch_syscall((u64) arg1, (u64) arg2, (u64) arg3, (u64) arg4, (u64) arg5);
160 break;
161 }
163 {
164 pr_dinfo2(syscall, "vfs_mount(device='%s', mount_point='%s', fs_type='%s', options='%s')", (const char *) arg1, (const char *) arg2, (const char *) arg3, (const char *) arg4);
165 ret = (reg_t) impl_syscall_vfs_mount((const char *) arg1, (const char *) arg2, (const char *) arg3, (const char *) arg4);
166 break;
167 }
169 {
170 pr_dinfo2(syscall, "vfs_readlinkat(dirfd=%d, path='%s', buf=%p, buf_size=%zu)", (fd_t) arg1, (const char *) arg2, (void *) arg3, (size_t) arg4);
171 ret = (reg_t) impl_syscall_vfs_readlinkat((fd_t) arg1, (const char *) arg2, (char *) arg3, (size_t) arg4);
172 break;
173 }
175 {
176 pr_dinfo2(syscall, "vfs_unlinkat(dirfd=%d, path='%s')", (fd_t) arg1, (const char *) arg2);
177 ret = (reg_t) impl_syscall_vfs_unlinkat((fd_t) arg1, (const char *) arg2);
178 break;
179 }
181 {
182 pr_dinfo2(syscall, "vfs_symlink(link_path='%s', target='%s')", (const char *) arg1, (const char *) arg2);
183 ret = (reg_t) impl_syscall_vfs_symlink((const char *) arg1, (const char *) arg2);
184 break;
185 }
187 {
188 pr_dinfo2(syscall, "vfs_mkdir(path='%s')", (const char *) arg1);
189 ret = (reg_t) impl_syscall_vfs_mkdir((const char *) arg1);
190 break;
191 }
193 {
194 pr_dinfo2(syscall, "vfs_list_dir(fd=%d, buffer=%p, buffer_size=%zu)", (fd_t) arg1, (void *) arg2, (size_t) arg3);
195 ret = (reg_t) impl_syscall_vfs_list_dir((fd_t) arg1, (char *) arg2, (size_t) arg3);
196 break;
197 }
199 {
200 pr_dinfo2(syscall, "fd_manipulate(fd=%d, cmd=%llu, arg=%p)", (fd_t) arg1, (u64) arg2, (void *) arg3);
201 ret = (reg_t) impl_syscall_fd_manipulate((fd_t) arg1, (u64) arg2, (void *) arg3);
202 break;
203 }
205 {
206 pr_dinfo2(syscall, "mmap_anonymous(hint_addr=" PTR_FMT ", size=%zu, perm=%d, flags=%d)", (ptr_t) arg1, (size_t) arg2, (mem_perm_t) arg3, (mmap_flags_t) arg4);
207 ret = (reg_t) impl_syscall_mmap_anonymous((ptr_t) arg1, (size_t) arg2, (mem_perm_t) arg3, (mmap_flags_t) arg4);
208 break;
209 }
211 {
212 pr_dinfo2(syscall, "mmap_file(hint_addr=" PTR_FMT ", size=%zu, perm=%d, flags=%d, fd=%d, offset=%zd)", (ptr_t) arg1, (size_t) arg2, (mem_perm_t) arg3, (mmap_flags_t) arg4, (fd_t) arg5, (off_t) arg6);
213 ret = (reg_t) impl_syscall_mmap_file((ptr_t) arg1, (size_t) arg2, (mem_perm_t) arg3, (mmap_flags_t) arg4, (fd_t) arg5, (off_t) arg6);
214 break;
215 }
217 {
218 pr_dinfo2(syscall, "wait_for_process(pid=%d, exit_code=%p, flags=%u)", (pid_t) arg1, (void *) arg2, (u32) arg3);
219 ret = (reg_t) impl_syscall_wait_for_process((pid_t) arg1, (u32 *) arg2, (u32) arg3);
220 break;
221 }
222 case SYSCALL_munmap:
223 {
224 pr_dinfo2(syscall, "munmap(addr=%p, size=%zu)", (void *) arg1, (size_t) arg2);
225 ret = (reg_t) impl_syscall_munmap((void *) arg1, (size_t) arg2);
226 break;
227 }
229 {
230 pr_dinfo2(syscall, "vfs_chdirat(dirfd=%d, path='%s')", (fd_t) arg1, (const char *) arg2);
231 ret = (reg_t) impl_syscall_vfs_chdirat((fd_t) arg1, (const char *) arg2);
232 break;
233 }
235 {
236 pr_dinfo2(syscall, "vfs_getcwd(buf=%p, buf_size=%zu)", (void *) arg1, (size_t) arg2);
237 ret = (reg_t) impl_syscall_vfs_getcwd((char *) arg1, (size_t) arg2);
238 break;
239 }
240 case SYSCALL_io_seek:
241 {
242 pr_dinfo2(syscall, "io_seek(fd=%d, offset=%zd, whence=%d)", (fd_t) arg1, (off_t) arg2, (io_seek_whence_t) arg3);
243 ret = (reg_t) impl_syscall_io_seek((fd_t) arg1, (off_t) arg2, (io_seek_whence_t) arg3);
244 break;
245 }
246 case SYSCALL_io_tell:
247 {
248 pr_dinfo2(syscall, "io_tell(fd=%d)", (fd_t) arg1);
249 ret = (reg_t) impl_syscall_io_tell((fd_t) arg1);
250 break;
251 }
253 {
254 pr_dinfo2(syscall, "signal_register(signum=%d, action=%p)", (signal_t) arg1, (void *) arg2);
255 ret = (reg_t) impl_syscall_signal_register((signal_t) arg1, (const sigaction_t *) arg2);
256 break;
257 }
259 {
260 pr_dinfo2(syscall, "signal_process(pid=%d, signum=%d)", (pid_t) arg1, (signal_t) arg2);
261 ret = (reg_t) impl_syscall_signal_process((pid_t) arg1, (signal_t) arg2);
262 break;
263 }
265 {
266 pr_dinfo2(syscall, "signal_thread(tid=%d, signum=%d)", (tid_t) arg1, (signal_t) arg2);
267 ret = (reg_t) impl_syscall_signal_thread((tid_t) arg1, (signal_t) arg2);
268 break;
269 }
270 case SYSCALL_poweroff:
271 {
272 pr_dinfo2(syscall, "poweroff(reboot=%d, magic=%u)", (bool) arg1, (u32) arg2);
273 impl_syscall_poweroff((bool) arg1, (u32) arg2);
274 break;
275 }
277 {
278 pr_dinfo2(syscall, "signal_return(sp=%p)", (void *) arg1);
279 impl_syscall_signal_return((void *) arg1);
280 break;
281 }
283 {
284 pr_dinfo2(syscall, "vm_protect(addr=%p, size=%zu, perm=%d)", (void *) arg1, (size_t) arg2, (mem_perm_t) arg3);
285 ret = (reg_t) impl_syscall_vm_protect((void *) arg1, (size_t) arg2, (mem_perm_t) arg3);
286 break;
287 }
288 case SYSCALL_io_poll:
289 {
290 pr_dinfo2(syscall, "io_poll(fds=%p, nfds=%ld, timeout=%d)", (void *) arg1, (nfds_t) arg2, (int) arg3);
291 ret = (reg_t) impl_syscall_io_poll((struct pollfd *) arg1, (nfds_t) arg2, (int) arg3);
292 break;
293 }
295 {
296 pr_dinfo2(syscall, "io_pselect(nfds=%d, readfds=%p, writefds=%p, exceptfds=%p, timeout=%p, sigmask=%p)", (int) arg1, (void *) arg2, (void *) arg3, (void *) arg4, (void *) arg5, (void *) arg6);
297 ret = (reg_t) impl_syscall_io_pselect((int) arg1, (fd_set *) arg2, (fd_set *) arg3, (fd_set *) arg4, (const struct timespec *) arg5, (const sigset_t *) arg6);
298 break;
299 }
300 case SYSCALL_execveat:
301 {
302 pr_dinfo2(syscall, "execveat(dirfd=%d, file_path='%s', argv=%p, envp=%p, flags=%u)", (fd_t) arg1, (const char *) arg2, (void *) arg3, (void *) arg4, (u32) arg5);
303 ret = (reg_t) impl_syscall_execveat((fd_t) arg1, (const char *) arg2, (const char *const *) arg3, (const char *const *) arg4, (u32) arg5);
304 break;
305 }
307 {
308 pr_dinfo2(syscall, "clock_msleep(ms=%llu)", (u64) arg1);
309 ret = (reg_t) impl_syscall_clock_msleep((u64) arg1);
310 break;
311 }
312 case SYSCALL_io_dup:
313 {
314 pr_dinfo2(syscall, "io_dup(fd=%d)", (fd_t) arg1);
315 ret = (reg_t) impl_syscall_io_dup((fd_t) arg1);
316 break;
317 }
318 case SYSCALL_io_dup2:
319 {
320 pr_dinfo2(syscall, "io_dup2(old_fd=%d, new_fd=%d)", (fd_t) arg1, (fd_t) arg2);
321 ret = (reg_t) impl_syscall_io_dup2((fd_t) arg1, (fd_t) arg2);
322 break;
323 }
325 {
326 pr_dinfo2(syscall, "dmabuf_alloc(n_pages=%zu, out_paddr=%p, out_vaddr=%p)", (size_t) arg1, (void *) arg2, (void *) arg3);
327 ret = (reg_t) impl_syscall_dmabuf_alloc((size_t) arg1, (ptr_t *) arg2, (ptr_t *) arg3);
328 break;
329 }
331 {
332 pr_dinfo2(syscall, "dmabuf_free(vaddr=" PTR_FMT ", paddr=" PTR_FMT ")", (ptr_t) arg1, (ptr_t) arg2);
333 ret = (reg_t) impl_syscall_dmabuf_free((ptr_t) arg1, (ptr_t) arg2);
334 break;
335 }
337 {
338 pr_dinfo2(syscall, "dmabuf_share(buf=%p, bufsize=%zu, out_paddr=%p)", (void *) arg1, (size_t) arg2, (void *) arg3);
339 ret = (reg_t) impl_syscall_dmabuf_share((void *) arg1, (size_t) arg2, (ptr_t *) arg3);
340 break;
341 }
343 {
344 pr_dinfo2(syscall, "dmabuf_unshare(paddr=" PTR_FMT ", size=%zu, vaddr=%p)", (ptr_t) arg1, (size_t) arg2, (void *) arg3);
345 ret = (reg_t) impl_syscall_dmabuf_unshare((ptr_t) arg1, (size_t) arg2, (void *) arg3);
346 break;
347 }
348 case SYSCALL_pipe:
349 {
350 pr_dinfo2(syscall, "pipe(out_read_fd=%p, out_write_fd=%p, flags=%d)", (void *) arg1, (void *) arg2, (fd_flags_t) arg3);
351 ret = (reg_t) impl_syscall_pipe((fd_t *) arg1, (fd_t *) arg2, (fd_flags_t) arg3);
352 break;
353 }
354 case SYSCALL_io_readv:
355 {
356 pr_dinfo2(syscall, "io_readv(fd=%d, iov=%p, iov_count=%d)", (fd_t) arg1, (void *) arg2, (int) arg3);
357 ret = (reg_t) impl_syscall_io_readv((fd_t) arg1, (const struct iovec *) arg2, (int) arg3);
358 break;
359 }
361 {
362 pr_dinfo2(syscall, "vfs_unmount(mount_point='%s')", (const char *) arg1);
363 ret = (reg_t) impl_syscall_vfs_unmount((const char *) arg1);
364 break;
365 }
367 {
368 pr_dinfo2(syscall, "clock_gettimeofday(tv=%p)", (void *) arg1);
369 ret = (reg_t) impl_syscall_clock_gettimeofday((struct timespec *) arg1);
370 break;
371 }
373 {
374 pr_dinfo2(syscall, "thread_setname(tid=%d, name='%s')", (tid_t) arg1, (const char *) arg2);
375 ret = (reg_t) impl_syscall_thread_setname((tid_t) arg1, (const char *) arg2);
376 break;
377 }
379 {
380 pr_dinfo2(syscall, "thread_getname(tid=%d, buf=%p, buf_size=%zu)", (tid_t) arg1, (void *) arg2, (size_t) arg3);
381 ret = (reg_t) impl_syscall_thread_getname((tid_t) arg1, (char *) arg2, (size_t) arg3);
382 break;
383 }
385 {
386 pr_dinfo2(syscall, "vfs_fchmodat(dirfd=%d, path='%s', mode=%d, flags=%d)", (fd_t) arg1, (const char *) arg2, (int) arg3, (int) arg4);
387 ret = (reg_t) impl_syscall_vfs_fchmodat((fd_t) arg1, (const char *) arg2, (int) arg3, (int) arg4);
388 break;
389 }
390 case SYSCALL_io_pread:
391 {
392 pr_dinfo2(syscall, "io_pread(fd=%d, buf=%p, count=%zu, offset=%zd)", (fd_t) arg1, (void *) arg2, (size_t) arg3, (off_t) arg4);
393 ret = (reg_t) impl_syscall_io_pread((fd_t) arg1, (void *) arg2, (size_t) arg3, (off_t) arg4);
394 break;
395 }
397 {
398 pr_dinfo2(syscall, "memfd_create(name='%s', flags=%u)", (const char *) arg1, (u32) arg2);
399 ret = (reg_t) impl_syscall_memfd_create((const char *) arg1, (u32) arg2);
400 break;
401 }
403 {
404 pr_dinfo2(syscall, "signal_mask_op(how=%d, set=%p, oldset=%p)", (int) arg1, (void *) arg2, (void *) arg3);
405 ret = (reg_t) impl_syscall_signal_mask_op((int) arg1, (const sigset_t *) arg2, (sigset_t *) arg3);
406 break;
407 }
409 {
410 pr_dinfo2(syscall, "vfs_fsync(fd=%d, data_only=%d)", (fd_t) arg1, (bool) arg2);
411 ret = (reg_t) impl_syscall_vfs_fsync((fd_t) arg1, (bool) arg2);
412 break;
413 }
414 }
415
416 pr_dcont(syscall, " = 0x%lx", ret);
417 return ret;
418}
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)
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)
should_inline reg_t dispatch_syscall(const reg_t number, reg_t arg1, reg_t arg2, reg_t arg3, reg_t arg4, reg_t arg5, reg_t arg6)
Definition dispatcher.h:23
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
mem_perm_t
Definition mm_types.h:7
mmap_flags_t
Definition mm_types.h:15
#define should_inline
Definition mos_global.h:37
#define MOS_UNUSED(x)
Definition mos_global.h:64
#define SYSCALL_dmabuf_alloc
Definition number.h:154
#define SYSCALL_poweroff
Definition number.h:127
#define SYSCALL_vfs_mount
Definition number.h:73
#define SYSCALL_mmap_file
Definition number.h:97
#define SYSCALL_dmabuf_share
Definition number.h:160
#define SYSCALL_io_readv
Definition number.h:169
#define SYSCALL_get_pid
Definition number.h:34
#define SYSCALL_vfs_fsync
Definition number.h:196
#define SYSCALL_exit
Definition number.h:25
#define SYSCALL_fd_manipulate
Definition number.h:91
#define SYSCALL_yield_cpu
Definition number.h:28
#define SYSCALL_vm_protect
Definition number.h:133
#define SYSCALL_signal_register
Definition number.h:118
#define SYSCALL_vfs_unlinkat
Definition number.h:79
#define SYSCALL_io_dup
Definition number.h:148
#define SYSCALL_ipc_accept
Definition number.h:64
#define SYSCALL_execveat
Definition number.h:142
#define SYSCALL_io_poll
Definition number.h:136
#define SYSCALL_io_close
Definition number.h:22
#define SYSCALL_get_tid
Definition number.h:46
#define SYSCALL_wait_for_thread
Definition number.h:52
#define SYSCALL_wait_for_process
Definition number.h:100
#define SYSCALL_io_tell
Definition number.h:115
#define SYSCALL_fork
Definition number.h:31
#define SYSCALL_vfs_readlinkat
Definition number.h:76
#define SYSCALL_thread_getname
Definition number.h:181
#define SYSCALL_memfd_create
Definition number.h:190
#define SYSCALL_futex_wake
Definition number.h:58
#define SYSCALL_arch_syscall
Definition number.h:70
#define SYSCALL_signal_thread
Definition number.h:124
#define SYSCALL_clock_msleep
Definition number.h:145
#define SYSCALL_dmabuf_unshare
Definition number.h:163
#define SYSCALL_vfs_unmount
Definition number.h:172
#define SYSCALL_io_dup2
Definition number.h:151
#define SYSCALL_io_write
Definition number.h:19
#define SYSCALL_ipc_connect
Definition number.h:67
#define SYSCALL_vfs_fstatat
Definition number.h:13
#define SYSCALL_thread_exit
Definition number.h:49
#define SYSCALL_thread_setname
Definition number.h:178
#define SYSCALL_mmap_anonymous
Definition number.h:94
#define SYSCALL_signal_mask_op
Definition number.h:193
#define SYSCALL_io_seek
Definition number.h:112
#define SYSCALL_signal_process
Definition number.h:121
#define SYSCALL_vfs_list_dir
Definition number.h:88
#define SYSCALL_futex_wait
Definition number.h:55
#define SYSCALL_clock_gettimeofday
Definition number.h:175
#define SYSCALL_vfs_fchmodat
Definition number.h:184
#define SYSCALL_io_pread
Definition number.h:187
#define SYSCALL_io_pselect
Definition number.h:139
#define SYSCALL_spawn
Definition number.h:40
#define SYSCALL_dmabuf_free
Definition number.h:157
#define SYSCALL_create_thread
Definition number.h:43
#define SYSCALL_vfs_openat
Definition number.h:10
#define SYSCALL_vfs_mkdir
Definition number.h:85
#define SYSCALL_ipc_create
Definition number.h:61
#define SYSCALL_vfs_getcwd
Definition number.h:109
#define SYSCALL_vfs_chdirat
Definition number.h:106
#define SYSCALL_munmap
Definition number.h:103
#define SYSCALL_get_parent_pid
Definition number.h:37
#define SYSCALL_signal_return
Definition number.h:130
#define SYSCALL_io_read
Definition number.h:16
#define SYSCALL_vfs_symlink
Definition number.h:82
#define SYSCALL_pipe
Definition number.h:166
#define pr_dcont(feat, fmt,...)
Definition printk.h:33
#define pr_dinfo2(feat, fmt,...)
Definition printk.h:27
int signal_t
Definition signal_types.h:9
uintn reg_t
Definition types.h:51
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
#define PTR_FMT
Definition types.h:33
s32 pid_t
Definition types.h:78
unsigned long ptr_t
Definition types.h:25
unsigned long long u64
Definition types.h:23