Fennix  1.0.0
Full Documentation
Loading...
Searching...
No Matches
syscalls.h
Go to the documentation of this file.
1/*
2 This file is part of Fennix Kernel.
3
4 Fennix Kernel is free software: you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation, either version 3 of
7 the License, or (at your option) any later version.
8
9 Fennix Kernel is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
16*/
17
18#ifndef __FENNIX_API_SYSTEM_CALLS_LIST_H__
19#define __FENNIX_API_SYSTEM_CALLS_LIST_H__
20
21#if __has_include(<interface/fcntl.h>)
22#include <interface/fcntl.h>
23#else
24#include <fcntl.h>
25#endif
26
27#ifndef __fennix__
28#error "__fennix__ not defined"
29#endif
30
31#pragma region Syscall Wrappers
32
33#define scarg __UINTPTR_TYPE__
34
35#ifdef __arm__
36#ifdef __thumb__
37#define __thumb_r7
38#define __arm_call(...)
39#warning "arm thumb code not implemented"
40#else /* __thumb__ */
41#define __thumb_r7 __asm__("r7")
42#define __arm_call(...) \
43 __asm__ __volatile__("svc 0" \
44 : "=r"(r0) \
45 : __VA_ARGS__ \
46 : "memory")
47#endif /* __thumb__ */
48
49#ifdef __thumb2__
50#define __r7_operand "rI"(r7)
51#else /* __thumb2__ */
52#define __r7_operand "r"(r7)
53#endif /* __thumb2__ */
54#endif /* __arm__ */
55
64static inline scarg syscall0(scarg syscall)
65{
66 scarg ret;
67#if defined(__amd64__)
68 __asm__ __volatile__("syscall"
69 : "=a"(ret)
70 : "a"(syscall)
71 : "rcx", "r11", "memory");
72#elif defined(__i386__)
73 __asm__ __volatile__("int $0x30"
74 : "=a"(ret)
75 : "a"(syscall)
76 : "memory");
77#elif defined(__arm__)
78 register scarg r7 __thumb_r7 = syscall;
79 register scarg r0 __asm__("r0");
80 __arm_call(__r7_operand);
81#elif defined(__aarch64__)
82 register scarg x8 __asm__("x8") = syscall;
83 register scarg x0 __asm__("x0");
84 __asm__ __volatile__("svc 0"
85 : "=r"(x0)
86 : "r"(x8)
87 : "memory", "cc");
88#else
89#error "Unsupported architecture"
90#endif
91 return ret;
92}
93
103static inline scarg syscall1(scarg syscall, scarg arg1)
104{
105 scarg ret;
106#if defined(__amd64__)
107 __asm__ __volatile__("syscall"
108 : "=a"(ret)
109 : "a"(syscall), "D"(arg1)
110 : "rcx", "r11", "memory");
111#elif defined(__i386__)
112 __asm__ __volatile__("int $0x30"
113 : "=a"(ret)
114 : "a"(syscall), "b"(arg1)
115 : "memory");
116#elif defined(__arm__)
117 register scarg r7 __thumb_r7 = syscall;
118 register scarg r0 __asm__("r0") = arg1;
119 __arm_call(__r7_operand, "0"(r0));
120#elif defined(__aarch64__)
121 register scarg x8 __asm__("x8") = syscall;
122 register scarg x0 __asm__("x0") = arg1;
123 __asm__ __volatile__("svc 0"
124 : "=r"(ret)
125 : "r"(x8), "0"(x0)
126 : "memory", "cc");
127#else
128#error "Unsupported architecture"
129#endif
130 return ret;
131}
132
143static inline scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
144{
145 scarg ret;
146#if defined(__amd64__)
147 __asm__ __volatile__("syscall"
148 : "=a"(ret)
149 : "a"(syscall), "D"(arg1), "S"(arg2)
150 : "rcx", "r11", "memory");
151#elif defined(__i386__)
152 __asm__ __volatile__("int $0x30"
153 : "=a"(ret)
154 : "a"(syscall), "b"(arg1), "c"(arg2)
155 : "memory");
156#elif defined(__arm__)
157 register scarg r7 __thumb_r7 = syscall;
158 register scarg r0 __asm__("r0") = arg1;
159 register scarg r1 __asm__("r1") = arg2;
160 __arm_call(__r7_operand, "0"(r0), "r"(r1));
161#elif defined(__aarch64__)
162 register scarg x8 __asm__("x8") = syscall;
163 register scarg x0 __asm__("x0") = arg1;
164 register scarg x1 __asm__("x1") = arg2;
165 __asm__ __volatile__("svc 0"
166 : "=r"(ret)
167 : "r"(x8), "0"(x0), "r"(x1)
168 : "memory", "cc");
169#else
170#error "Unsupported architecture"
171#endif
172 return ret;
173}
174
186static inline scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
187{
188 scarg ret;
189#if defined(__amd64__)
190 __asm__ __volatile__("syscall"
191 : "=a"(ret)
192 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3)
193 : "rcx", "r11", "memory");
194#elif defined(__i386__)
195 __asm__ __volatile__("int $0x30"
196 : "=a"(ret)
197 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3)
198 : "memory");
199#elif defined(__arm__)
200 register scarg r7 __thumb_r7 = syscall;
201 register scarg r0 __asm__("r0") = arg1;
202 register scarg r1 __asm__("r1") = arg2;
203 register scarg r2 __asm__("r2") = arg3;
204 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2));
205#elif defined(__aarch64__)
206 register scarg x8 __asm__("x8") = syscall;
207 register scarg x0 __asm__("x0") = arg1;
208 register scarg x1 __asm__("x1") = arg2;
209 register scarg x2 __asm__("x2") = arg3;
210 __asm__ __volatile__("svc 0"
211 : "=r"(ret)
212 : "r"(x8), "0"(x0), "r"(x1), "r"(x2)
213 : "memory", "cc");
214#else
215#error "Unsupported architecture"
216#endif
217 return ret;
218}
219
232static inline scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
233{
234 scarg ret;
235#if defined(__amd64__)
236 register scarg r10 __asm__("r10") = arg4;
237 __asm__ __volatile__("syscall"
238 : "=a"(ret)
239 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10)
240 : "rcx", "r11", "memory");
241#elif defined(__i386__)
242 __asm__ __volatile__("int $0x30"
243 : "=a"(ret)
244 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3), "S"(arg4)
245 : "memory");
246#elif defined(__arm__)
247 register scarg r7 __thumb_r7 = syscall;
248 register scarg r0 __asm__("r0") = arg1;
249 register scarg r1 __asm__("r1") = arg2;
250 register scarg r2 __asm__("r2") = arg3;
251 register scarg r3 __asm__("r3") = arg4;
252 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2), "r"(r3));
253#elif defined(__aarch64__)
254 register scarg x8 __asm__("x8") = syscall;
255 register scarg x0 __asm__("x0") = arg1;
256 register scarg x1 __asm__("x1") = arg2;
257 register scarg x2 __asm__("x2") = arg3;
258 register scarg x3 __asm__("x3") = arg4;
259 __asm__ __volatile__("svc 0"
260 : "=r"(ret)
261 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3)
262 : "memory", "cc");
263#else
264#error "Unsupported architecture"
265#endif
266 return ret;
267}
268
282static inline scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
283{
284 scarg ret;
285#if defined(__amd64__)
286 register scarg r10 __asm__("r10") = arg4;
287 register scarg r8 __asm__("r8") = arg5;
288 __asm__ __volatile__("syscall"
289 : "=a"(ret)
290 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8)
291 : "rcx", "r11", "memory");
292#elif defined(__i386__)
293 __asm__ __volatile__("int $0x30"
294 : "=a"(ret)
295 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3), "S"(arg4), "D"(arg5)
296 : "memory");
297#elif defined(__arm__)
298 register scarg r7 __thumb_r7 = syscall;
299 register scarg r0 __asm__("r0") = arg1;
300 register scarg r1 __asm__("r1") = arg2;
301 register scarg r2 __asm__("r2") = arg3;
302 register scarg r3 __asm__("r3") = arg4;
303 register scarg r4 __asm__("r4") = arg5;
304 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4));
305#elif defined(__aarch64__)
306 register scarg x8 __asm__("x8") = syscall;
307 register scarg x0 __asm__("x0") = arg1;
308 register scarg x1 __asm__("x1") = arg2;
309 register scarg x2 __asm__("x2") = arg3;
310 register scarg x3 __asm__("x3") = arg4;
311 register scarg x4 __asm__("x4") = arg5;
312 __asm__ __volatile__("svc 0"
313 : "=r"(ret)
314 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4)
315 : "memory", "cc");
316#else
317#error "Unsupported architecture"
318#endif
319 return ret;
320}
321
336static inline scarg syscall6(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5, scarg arg6)
337{
338 scarg ret;
339#if defined(__amd64__)
340 register scarg r10 __asm__("r10") = arg4;
341 register scarg r8 __asm__("r8") = arg5;
342 register scarg r9 __asm__("r9") = arg6;
343 __asm__ __volatile__("syscall"
344 : "=a"(ret)
345 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8), "r"(r9)
346 : "rcx", "r11", "memory");
347#elif defined(__i386__)
348 __asm__ __volatile__("int $0x30"
349 : "=a"(ret)
350 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3), "S"(arg4), "D"(arg5), "g"(arg6)
351 : "memory");
352#elif defined(__arm__)
353 register scarg r7 __thumb_r7 = syscall;
354 register scarg r0 __asm__("r0") = arg1;
355 register scarg r1 __asm__("r1") = arg2;
356 register scarg r2 __asm__("r2") = arg3;
357 register scarg r3 __asm__("r3") = arg4;
358 register scarg r4 __asm__("r4") = arg5;
359 register scarg r5 __asm__("r5") = arg6;
360 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5));
361#elif defined(__aarch64__)
362 register scarg x8 __asm__("x8") = syscall;
363 register scarg x0 __asm__("x0") = arg1;
364 register scarg x1 __asm__("x1") = arg2;
365 register scarg x2 __asm__("x2") = arg3;
366 register scarg x3 __asm__("x3") = arg4;
367 register scarg x4 __asm__("x4") = arg5;
368 register scarg x5 __asm__("x5") = arg6;
369 __asm__ __volatile__("svc 0"
370 : "=r"(ret)
371 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5)
372 : "memory", "cc");
373#else
374#error "Unsupported architecture"
375#endif
376 return ret;
377}
378
379#pragma endregion Syscall Wrappers
380
388#define __SYS_NULL ((void *)0)
389
403
419
427
435#ifdef __kernel__
436typedef syscall_prctl_options_t prctl_options_t;
437#endif
438
445
446typedef enum
447{
449 /* Process abort signal. */
451 /* Alarm clock. */
453 /* Access to an undefined portion of a memory object. */
455 /* Child process terminated, stopped, or continued. */
457 /* Continue executing, if stopped. */
459 /* Erroneous arithmetic operation. */
461 /* Hangup. */
463 /* Illegal instruction. */
465 /* Terminal interrupt signal. */
467 /* Kill (cannot be caught or ignored). */
469 /* Write on a pipe with no one to read it. */
471 /* Terminal quit signal. */
473 /* Invalid memory reference. */
475 /* Stop executing (cannot be caught or ignored). */
477 /* Termination signal. */
479 /* Terminal stop signal. */
481 /* Background process attempting read. */
483 /* Background process attempting write. */
485 /* User-defined signal 1. */
487 /* User-defined signal 2. */
489 /* Pollable event. */
491 /* Profiling timer expired. */
493 /* Bad system call. */
495 /* Trace/breakpoint trap. */
497 /* High bandwidth data is available at a socket. */
499 /* Virtual timer expired. */
501 /* CPU time limit exceeded. */
503 /* File size limit exceeded. */
505
513
514 /* Real-time signals. */
548
549 /* Maximum signal number. */
552#ifdef __kernel__
553typedef syscall_signal_t signal_t;
554#endif
555
569#ifdef __kernel__
570typedef syscall_signal_disposition_t signal_disposition_t;
571#endif
572
579
590
597
605
606#ifndef __cplusplus
607_Static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
608#else
609static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
610#endif
611
612typedef int __SYS_clockid_t;
613typedef unsigned int __SYS_socklen_t;
614
616{
617 __UINT32_TYPE__ Width;
618 __UINT32_TYPE__ Height;
619 __UINT32_TYPE__ Pitch;
620 __UINT32_TYPE__ Bpp;
621 __UINT32_TYPE__ Size;
623
635#define FBIOGET_SCREEN_INFO 0xf0
636
638{
639 char sysname[65];
640 char release[65];
641 char version[65];
642 char machine[65];
643};
644
1673
1674/* Initialization */
1675
1677#define call_api_version(version) syscall1(SYS_API_VERSION, (scarg)version)
1678
1679/* I/O */
1680
1682#define call_read(fd, buf, count) syscall3(SYS_READ, (scarg)fd, (scarg)buf, (scarg)count)
1683
1685#define call_pread(fd, buf, count, offset) syscall4(SYS_PREAD, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1686
1688#define call_write(fd, buf, count) syscall3(SYS_WRITE, (scarg)fd, (scarg)buf, (scarg)count)
1689
1691#define call_pwrite(fd, buf, count, offset) syscall4(SYS_PWRITE, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1692
1694#define call_open(pathname, flags, mode) syscall3(SYS_OPEN, (scarg)pathname, (scarg)flags, (scarg)mode)
1695
1697#define call_close(fd) syscall1(SYS_CLOSE, fd)
1698
1700#define call_ioctl(fd, request, argp) syscall3(SYS_IOCTL, (scarg)fd, (scarg)request, (scarg)argp)
1701
1703#define call_fcntl(fd, cmd, arg) syscall3(SYS_FCNTL, (scarg)fd, (scarg)cmd, (scarg)arg)
1704
1705/* File Status */
1706
1708#define call_stat(pathname, statbuf) syscall2(SYS_STAT, (scarg)pathname, (scarg)statbuf)
1709
1711#define call_fstat(fd, statbuf) syscall2(SYS_FSTAT, (scarg)fd, (scarg)statbuf)
1712
1714#define call_lstat(pathname, statbuf) syscall2(SYS_LSTAT, (scarg)pathname, (scarg)statbuf)
1715
1717#define call_access(pathname, mode) syscall2(SYS_ACCESS, (scarg)pathname, (scarg)mode)
1718
1720#define call_truncate(pathname, length) syscall2(SYS_TRUNCATE, (scarg)pathname, (scarg)length)
1721
1723#define call_ftruncate(fd, length) syscall2(SYS_FTRUNCATE, (scarg)fd, (scarg)length)
1724
1726#define call_tell(fd) syscall1(SYS_TELL, (scarg)fd)
1727
1729#define call_seek(fd, offset, whence) syscall3(SYS_SEEK, (scarg)fd, (scarg)offset, (scarg)whence)
1730
1731/* Process Control */
1732
1734#define call_exit(status) syscall1(SYS_EXIT, (scarg)status)
1735
1737#define call_fork() syscall0(SYS_FORK)
1738
1740#define call_execve(pathname, argv, envp) syscall3(SYS_EXECVE, (scarg)pathname, (scarg)argv, (scarg)envp)
1741
1743#define call_getpid() syscall0(SYS_GETPID)
1744
1746#define call_getppid() syscall0(SYS_GETPPID)
1747
1749#define call_waitpid(pid, wstatus, options) syscall3(SYS_WAITPID, (scarg)pid, (scarg)wstatus, (scarg)options)
1750
1752#define call_kill(pid, sig) syscall2(SYS_KILL, (scarg)pid, (scarg)sig)
1753
1755#define call_prctl(option, arg1, arg2, arg3, arg4) syscall5(SYS_PRCTL, (scarg)option, (scarg)arg1, (scarg)arg2, (scarg)arg3, (scarg)arg4)
1756
1757/* Memory */
1758
1760#define call_brk(end_data) syscall1(SYS_BRK, (scarg)end_data)
1761
1763#define call_mmap(addr, length, prot, flags, fd, offset) syscall6(SYS_MMAP, (scarg)addr, (scarg)length, (scarg)prot, (scarg)flags, (scarg)fd, (scarg)offset)
1764
1766#define call_munmap(addr, length) syscall2(SYS_MUNMAP, (scarg)addr, (scarg)length)
1767
1769#define call_mprotect(addr, length, prot) syscall3(SYS_MPROTECT, (scarg)addr, (scarg)length, (scarg)prot)
1770
1772#define call_madvise(addr, length, advice) syscall3(SYS_MADVISE, (scarg)addr, (scarg)length, (scarg)advice)
1773
1774/* Communication */
1775
1777#define call_pipe(pipefd) syscall1(SYS_PIPE, (scarg)pipefd)
1778
1780#define call_dup(oldfd) syscall1(SYS_DUP, (scarg)oldfd)
1781
1783#define call_dup2(oldfd, newfd) syscall2(SYS_DUP2, (scarg)oldfd, (scarg)newfd)
1784
1786#define call_socket(domain, type, protocol) syscall3(SYS_SOCKET, (scarg)domain, (scarg)type, (scarg)protocol)
1787
1789#define call_bind(sockfd, addr, addrlen) syscall3(SYS_BIND, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1790
1792#define call_connect(sockfd, addr, addrlen) syscall3(SYS_CONNECT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1793
1795#define call_listen(sockfd, backlog) syscall2(SYS_LISTEN, (scarg)sockfd, (scarg)backlog)
1796
1798#define call_accept(sockfd, addr, addrlen) syscall3(SYS_ACCEPT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1799
1801#define call_send(sockfd, buf, len, flags) syscall4(SYS_SEND, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1802
1804#define call_recv(sockfd, buf, len, flags) syscall4(SYS_RECV, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1805
1807#define call_shutdown(sockfd, how) syscall2(SYS_SHUTDOWN, (scarg)sockfd, (scarg)how)
1808
1809/* Time */
1810
1812#define call_time(t) syscall1(SYS_TIME, (scarg)t)
1813
1815#define call_clock_gettime(clockid, tp) syscall2(SYS_CLOCK_GETTIME, (scarg)clockid, (scarg)tp)
1816
1818#define call_clock_settime(clockid, tp) syscall2(SYS_CLOCK_SETTIME, (scarg)clockid, (scarg)tp)
1819
1821#define call_nanosleep(req, rem) syscall2(SYS_NANOSLEEP, (scarg)req, (scarg)rem)
1822
1823/* Miscellaneous */
1824
1826#define call_getcwd(buf, size) syscall2(SYS_GETCWD, (scarg)buf, (scarg)size)
1827
1829#define call_chdir(path) syscall1(SYS_CHDIR, (scarg)path)
1830
1832#define call_mkdir(path, mode) syscall2(SYS_MKDIR, (scarg)path, (scarg)mode)
1833
1835#define call_rmdir(path) syscall1(SYS_RMDIR, (scarg)path)
1836
1838#define call_unlink(pathname) syscall1(SYS_UNLINK, (scarg)pathname)
1839
1841#define call_rename(oldpath, newpath) syscall2(SYS_RENAME, (scarg)oldpath, (scarg)newpath)
1842
1844#define call_uname(buf) syscall1(SYS_UNAME, (scarg)buf)
1845
1846#endif // !__FENNIX_API_SYSTEM_CALLS_LIST_H__
#define O_WRONLY
Definition fcntl.h:79
#define O_CREAT
Definition fcntl.h:59
#define O_NOCTTY
Definition fcntl.h:62
#define O_NONBLOCK
Definition fcntl.h:69
#define O_RDONLY
Definition fcntl.h:76
#define O_EXCL
Definition fcntl.h:61
#define O_SYNC
Definition fcntl.h:71
#define O_RDWR
Definition fcntl.h:77
#define O_RSYNC
Definition fcntl.h:70
#define O_TRUNC
Definition fcntl.h:64
#define O_APPEND
Definition fcntl.h:67
#define O_DSYNC
Definition fcntl.h:68
syscall_signal_t
Definition syscalls.h:447
@ __SYS_SIGRTMAX
Definition syscalls.h:547
@ __SYS_SIGRT_11
Definition syscalls.h:526
@ __SYS_SIGRT_7
Definition syscalls.h:522
@ __SYS_SIGTTIN
Definition syscalls.h:482
@ __SYS_SIGUSR1
Definition syscalls.h:486
@ __SYS_SIGTSTP
Definition syscalls.h:480
@ __SYS_SIGTERM
Definition syscalls.h:478
@ __SYS_SIGPOLL
Definition syscalls.h:490
@ __SYS_SIGFPE
Definition syscalls.h:460
@ __SYS_SIGKILL
Definition syscalls.h:468
@ __SYS_SIGCOMP3
Definition syscalls.h:512
@ __SYS_SIGRT_29
Definition syscalls.h:544
@ __SYS_SIGRT_9
Definition syscalls.h:524
@ __SYS_SIGRT_1
Definition syscalls.h:516
@ __SYS_SIGRT_23
Definition syscalls.h:538
@ __SYS_SIGQUIT
Definition syscalls.h:472
@ __SYS_SIGURG
Definition syscalls.h:498
@ __SYS_SIGRT_15
Definition syscalls.h:530
@ __SYS_SIGBUS
Definition syscalls.h:454
@ __SYS_SIGTRAP
Definition syscalls.h:496
@ __SYS_SIGRT_3
Definition syscalls.h:518
@ __SYS_SIGRT_13
Definition syscalls.h:528
@ __SYS_SIGCOMP1
Definition syscalls.h:510
@ __SYS_SIGRT_4
Definition syscalls.h:519
@ __SYS_SIGRT_24
Definition syscalls.h:539
@ __SYS_SIGRT_17
Definition syscalls.h:532
@ __SYS_SIGNULL
Definition syscalls.h:448
@ __SYS_SIGCOMP2
Definition syscalls.h:511
@ __SYS_SIGABRT
Definition syscalls.h:450
@ __SYS_SIGRT_5
Definition syscalls.h:520
@ __SYS_SIGTTOU
Definition syscalls.h:484
@ __SYS_SIGNAL_MAX
Definition syscalls.h:550
@ __SYS_SIGALRM
Definition syscalls.h:452
@ __SYS_SIGRT_28
Definition syscalls.h:543
@ __SYS_SIGXFSZ
Definition syscalls.h:504
@ __SYS_SIGINT
Definition syscalls.h:466
@ __SYS_SIGSEGV
Definition syscalls.h:474
@ __SYS_SIGVTALRM
Definition syscalls.h:500
@ __SYS_SIGCONT
Definition syscalls.h:458
@ __SYS_SIGRT_30
Definition syscalls.h:545
@ __SYS_SIGSTOP
Definition syscalls.h:476
@ __SYS_SIGRT_25
Definition syscalls.h:540
@ __SYS_SIGRT_12
Definition syscalls.h:527
@ __SYS_SIGHUP
Definition syscalls.h:462
@ __SYS_SIGRTMIN
Definition syscalls.h:515
@ __SYS_SIGPIPE
Definition syscalls.h:470
@ __SYS_SIGXCPU
Definition syscalls.h:502
@ __SYS_SIGRT_20
Definition syscalls.h:535
@ __SYS_SIGRT_10
Definition syscalls.h:525
@ __SYS_SIGRT_26
Definition syscalls.h:541
@ __SYS_SIGRT_31
Definition syscalls.h:546
@ __SYS_SIGRT_16
Definition syscalls.h:531
@ __SYS_SIGRT_14
Definition syscalls.h:529
@ __SYS_SIGRT_18
Definition syscalls.h:533
@ __SYS_SIGRT_8
Definition syscalls.h:523
@ __SYS_SIGRT_2
Definition syscalls.h:517
@ __SYS_SIGSYS
Definition syscalls.h:494
@ __SYS_SIGRT_21
Definition syscalls.h:536
@ __SYS_SIGRT_22
Definition syscalls.h:537
@ __SYS_SIGCHLD
Definition syscalls.h:456
@ __SYS_SIGRT_19
Definition syscalls.h:534
@ __SYS_SIGRT_27
Definition syscalls.h:542
@ __SYS_SIGPROF
Definition syscalls.h:492
@ __SYS_SIGILL
Definition syscalls.h:464
@ __SYS_SIGUSR2
Definition syscalls.h:488
@ __SYS_SIGRT_6
Definition syscalls.h:521
syscall_open_flags_t
Definition syscalls.h:405
@ __SYS_O_RDWR
Definition syscalls.h:408
@ __SYS_O_DSYNC
Definition syscalls.h:411
@ __SYS_O_NONBLOCK
Definition syscalls.h:414
@ __SYS_O_RDONLY
Definition syscalls.h:406
@ __SYS_O_RSYNC
Definition syscalls.h:415
@ __SYS_O_WRONLY
Definition syscalls.h:407
@ __SYS_O_NOCTTY
Definition syscalls.h:413
@ __SYS_O_EXCL
Definition syscalls.h:412
@ __SYS_O_APPEND
Definition syscalls.h:409
@ __SYS_O_SYNC
Definition syscalls.h:416
@ __SYS_O_TRUNC
Definition syscalls.h:417
@ __SYS_O_CREAT
Definition syscalls.h:410
__UINT32_TYPE__ Width
Definition syscalls.h:617
syscall_seek_whence_t
Definition syscalls.h:440
@ __SYS_SEEK_CUR
Definition syscalls.h:442
@ __SYS_SEEK_SET
Definition syscalls.h:441
@ __SYS_SEEK_END
Definition syscalls.h:443
char sysname[65]
Definition syscalls.h:639
char release[65]
Definition syscalls.h:640
__UINT32_TYPE__ Height
Definition syscalls.h:618
syscall_access_flags_t
Definition syscalls.h:421
@ __SYS_X_OK
Definition syscalls.h:425
@ __SYS_R_OK
Definition syscalls.h:423
@ __SYS_F_OK
Definition syscalls.h:422
@ __SYS_W_OK
Definition syscalls.h:424
char machine[65]
Definition syscalls.h:642
unsigned int __SYS_socklen_t
Definition syscalls.h:613
#define scarg
Definition syscalls.h:33
__UINT32_TYPE__ Pitch
Definition syscalls.h:619
syscall_signal_disposition_t
Definition syscalls.h:557
@ __SYS_SIG_TERM
Definition syscalls.h:559
@ __SYS_SIG_STOP
Definition syscalls.h:565
@ __SYS_SIG_CORE
Definition syscalls.h:567
@ __SYS_SIG_CONT
Definition syscalls.h:563
@ __SYS_SIG_IGN
Definition syscalls.h:561
syscalls_t
List of syscalls.
Definition syscalls.h:652
@ SYS_UNLINK
Remove a file.
Definition syscalls.h:1624
@ SYS_UNAME
Get unix name information.
Definition syscalls.h:1658
@ SYS_MMAP
Map files or devices into memory.
Definition syscalls.h:1213
@ SYS_SHUTDOWN
Shut down part of a full-duplex connection.
Definition syscalls.h:1466
@ SYS_RECV
Receive data on a socket.
Definition syscalls.h:1449
@ SYS_MAX
Max number of syscalls.
Definition syscalls.h:1671
@ SYS_STAT
Retrieve file status.
Definition syscalls.h:874
@ SYS_WRITE
Write to a file descriptor.
Definition syscalls.h:744
@ SYS_NANOSLEEP
Sleep for a specified time.
Definition syscalls.h:1536
@ SYS_TELL
Get the current file offset.
Definition syscalls.h:990
@ SYS_TRUNCATE
Change the size of a file.
Definition syscalls.h:956
@ SYS_PIPE
Create a pipe.
Definition syscalls.h:1288
@ SYS_RMDIR
Remove an empty directory.
Definition syscalls.h:1607
@ SYS_READ
Read from a file descriptor.
Definition syscalls.h:701
@ SYS_GETPPID
Get the parent process ID.
Definition syscalls.h:1094
@ SYS_CLOSE
Close a file descriptor.
Definition syscalls.h:815
@ SYS_MADVISE
Provide advice about memory usage.
Definition syscalls.h:1268
@ SYS_EXECVE
Execute a program.
Definition syscalls.h:1068
@ SYS_LISTEN
Listen for incoming connections on a socket.
Definition syscalls.h:1393
@ SYS_WAITPID
Wait for a child process to change state.
Definition syscalls.h:1112
@ SYS_BRK
Set the program break.
Definition syscalls.h:1170
@ SYS_MUNMAP
Unmap a mapped memory region.
Definition syscalls.h:1231
@ SYS_EXIT
Terminate the calling process.
Definition syscalls.h:1032
@ SYS_OPEN
Open a file.
Definition syscalls.h:799
@ SYS_CONNECT
Connect to a remote address.
Definition syscalls.h:1376
@ SYS_IOCTL
Control a device.
Definition syscalls.h:834
@ SYS_PREAD
Read from a file descriptor.
Definition syscalls.h:723
@ SYS_RENAME
Rename a file or directory.
Definition syscalls.h:1642
@ SYS_GETPID
Get the process ID of the calling process.
Definition syscalls.h:1081
@ SYS_FSTAT
Retrieve file status for an open file descriptor.
Definition syscalls.h:892
@ SYS_PWRITE
Write to a file descriptor.
Definition syscalls.h:765
@ SYS_BIND
Bind a socket to a local address.
Definition syscalls.h:1358
@ SYS_TIME
Get the current time.
Definition syscalls.h:1485
@ SYS_FCNTL
Function control.
Definition syscalls.h:853
@ SYS_DUP
Duplicate a file descriptor.
Definition syscalls.h:1304
@ SYS_SOCKET
Create an endpoint for communication.
Definition syscalls.h:1340
@ SYS_CLOCK_SETTIME
Set the current time of a specific clock.
Definition syscalls.h:1519
@ SYS_API_VERSION
Set syscall version.
Definition syscalls.h:675
@ SYS_FORK
Create a child process.
Definition syscalls.h:1048
@ SYS_SEND
Send data on a socket.
Definition syscalls.h:1430
@ SYS_PRCTL
Process/Thread Control.
Definition syscalls.h:1151
@ SYS_LSTAT
Retrieve file status with symbolic link resolution.
Definition syscalls.h:911
@ SYS_DUP2
Duplicate a file descriptor to a specific value.
Definition syscalls.h:1322
@ SYS_KILL
Send a signal to a process.
Definition syscalls.h:1130
@ SYS_MPROTECT
Change memory protection.
Definition syscalls.h:1249
@ SYS_MKDIR
Create a new directory.
Definition syscalls.h:1591
@ SYS_CHDIR
Change the current working directory.
Definition syscalls.h:1573
@ SYS_DEBUG_REPORT
Definition syscalls.h:677
@ SYS_ACCEPT
Accept an incoming connection on a socket.
Definition syscalls.h:1411
@ SYS_FTRUNCATE
Change the size of a file referred by a file descriptor.
Definition syscalls.h:974
@ SYS_SEEK
Set the file offset.
Definition syscalls.h:1014
@ SYS_GETCWD
Get the current working directory.
Definition syscalls.h:1556
@ SYS_CLOCK_GETTIME
Get the current time of a specific clock.
Definition syscalls.h:1502
@ SYS_ACCESS
Check a file's accessibility.
Definition syscalls.h:937
static scarg syscall6(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5, scarg arg6)
Syscall wrapper with 6 arguments.
Definition syscalls.h:336
syscall_clockid_t
Definition syscalls.h:599
@ __SYS_CLOCK_PROCESS_CPUTIME_ID
Definition syscalls.h:601
@ __SYS_CLOCK_REALTIME
Definition syscalls.h:602
@ __SYS_CLOCK_THREAD_CPUTIME_ID
Definition syscalls.h:603
@ __SYS_CLOCK_MONOTONIC
Definition syscalls.h:600
syscall_mmap_flags_t
Definition syscalls.h:391
@ __SYS_MAP_ANON
Definition syscalls.h:401
@ __SYS_PROT_NONE
Definition syscalls.h:395
@ __SYS_PROT_READ
Definition syscalls.h:392
@ __SYS_MAP_FIXED
Definition syscalls.h:399
@ __SYS_MAP_SHARED
Definition syscalls.h:397
@ __SYS_PROT_EXEC
Definition syscalls.h:394
@ __SYS_PROT_WRITE
Definition syscalls.h:393
@ __SYS_MAP_PRIVATE
Definition syscalls.h:398
@ __SYS_MAP_ANONYMOUS
Definition syscalls.h:400
syscall_prctl_options_t
Definition syscalls.h:429
@ __SYS_GET_FS
Definition syscalls.h:432
@ __SYS_SET_GS
Definition syscalls.h:431
@ __SYS_GET_GS
Definition syscalls.h:430
@ __SYS_SET_FS
Definition syscalls.h:433
char version[65]
Definition syscalls.h:641
static scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
Syscall wrapper with 5 arguments.
Definition syscalls.h:282
__UINT32_TYPE__ Bpp
Definition syscalls.h:620
static scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
Syscall wrapper with 4 arguments.
Definition syscalls.h:232
static scarg syscall1(scarg syscall, scarg arg1)
Syscall wrapper with 1 argument.
Definition syscalls.h:103
syscall_signal_actions_t
Definition syscalls.h:574
@ __SYS_SIG_UNBLOCK
Definition syscalls.h:576
@ __SYS_SIG_SETMASK
Definition syscalls.h:577
@ __SYS_SIG_BLOCK
Definition syscalls.h:575
static scarg syscall0(scarg syscall)
Syscall wrapper with 0 arguments.
Definition syscalls.h:64
syscall_signal_action_flags_t
Definition syscalls.h:581
@ __SYS_SA_SIGINFO
Definition syscalls.h:586
@ __SYS_SA_RESTART
Definition syscalls.h:585
@ __SYS_SA_RESETHAND
Definition syscalls.h:584
@ __SYS_SA_ONSTACK
Definition syscalls.h:583
@ __SYS_SA_NODEFER
Definition syscalls.h:588
@ __SYS_SA_NOCLDSTOP
Definition syscalls.h:582
@ __SYS_SA_NOCLDWAIT
Definition syscalls.h:587
static scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
Syscall wrapper with 2 arguments.
Definition syscalls.h:143
syscall_signal_action_disposition_t
Definition syscalls.h:592
@ __SYS_SIG_ERR
Definition syscalls.h:593
@ ___SYS_SIG_IGN
Definition syscalls.h:595
@ __SYS_SIG_DFL
Definition syscalls.h:594
static scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
Syscall wrapper with 3 arguments.
Definition syscalls.h:186
__UINT32_TYPE__ Size
Definition syscalls.h:621
int __SYS_clockid_t
Definition syscalls.h:612