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_SYSCALLS_LIST_H__
19#define __FENNIX_API_SYSCALLS_LIST_H__
20
21#pragma region Syscall Wrappers
22
23#define scarg __UINTPTR_TYPE__
24
25#ifdef __arm__
26#ifdef __thumb__
27#define __thumb_r7
28#define __arm_call(...)
29#warning "arm thumb code not implemented"
30#else /* __thumb__ */
31#define __thumb_r7 __asm__("r7")
32#define __arm_call(...) \
33 __asm__ __volatile__("svc 0" \
34 : "=r"(r0) \
35 : __VA_ARGS__ \
36 : "memory")
37#endif /* __thumb__ */
38
39#ifdef __thumb2__
40#define __r7_operand "rI"(r7)
41#else /* __thumb2__ */
42#define __r7_operand "r"(r7)
43#endif /* __thumb2__ */
44#endif /* __arm__ */
45
54static inline scarg syscall0(scarg syscall)
55{
56 scarg ret;
57#if defined(__amd64__)
58 __asm__ __volatile__("syscall"
59 : "=a"(ret)
60 : "a"(syscall)
61 : "rcx", "r11", "memory");
62#elif defined(__i386__)
63 __asm__ __volatile__("int $0x30"
64 : "=a"(ret)
65 : "a"(syscall)
66 : "memory");
67#elif defined(__arm__)
68 register scarg r7 __thumb_r7 = syscall;
69 register scarg r0 __asm__("r0");
70 __arm_call(__r7_operand);
71#elif defined(__aarch64__)
72 register scarg x8 __asm__("x8") = syscall;
73 register scarg x0 __asm__("x0");
74 __asm__ __volatile__("svc 0"
75 : "=r"(x0)
76 : "r"(x8)
77 : "memory", "cc");
78#else
79#error "Unsupported architecture"
80#endif
81 return ret;
82}
83
93static inline scarg syscall1(scarg syscall, scarg arg1)
94{
95 scarg ret;
96#if defined(__amd64__)
97 __asm__ __volatile__("syscall"
98 : "=a"(ret)
99 : "a"(syscall), "D"(arg1)
100 : "rcx", "r11", "memory");
101#elif defined(__i386__)
102 __asm__ __volatile__("int $0x30"
103 : "=a"(ret)
104 : "a"(syscall), "b"(arg1)
105 : "memory");
106#elif defined(__arm__)
107 register scarg r7 __thumb_r7 = syscall;
108 register scarg r0 __asm__("r0") = arg1;
109 __arm_call(__r7_operand, "0"(r0));
110#elif defined(__aarch64__)
111 register scarg x8 __asm__("x8") = syscall;
112 register scarg x0 __asm__("x0") = arg1;
113 __asm__ __volatile__("svc 0"
114 : "=r"(ret)
115 : "r"(x8), "0"(x0)
116 : "memory", "cc");
117#else
118#error "Unsupported architecture"
119#endif
120 return ret;
121}
122
133static inline scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
134{
135 scarg ret;
136#if defined(__amd64__)
137 __asm__ __volatile__("syscall"
138 : "=a"(ret)
139 : "a"(syscall), "D"(arg1), "S"(arg2)
140 : "rcx", "r11", "memory");
141#elif defined(__i386__)
142 __asm__ __volatile__("int $0x30"
143 : "=a"(ret)
144 : "a"(syscall), "b"(arg1), "c"(arg2)
145 : "memory");
146#elif defined(__arm__)
147 register scarg r7 __thumb_r7 = syscall;
148 register scarg r0 __asm__("r0") = arg1;
149 register scarg r1 __asm__("r1") = arg2;
150 __arm_call(__r7_operand, "0"(r0), "r"(r1));
151#elif defined(__aarch64__)
152 register scarg x8 __asm__("x8") = syscall;
153 register scarg x0 __asm__("x0") = arg1;
154 register scarg x1 __asm__("x1") = arg2;
155 __asm__ __volatile__("svc 0"
156 : "=r"(ret)
157 : "r"(x8), "0"(x0), "r"(x1)
158 : "memory", "cc");
159#else
160#error "Unsupported architecture"
161#endif
162 return ret;
163}
164
176static inline scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
177{
178 scarg ret;
179#if defined(__amd64__)
180 __asm__ __volatile__("syscall"
181 : "=a"(ret)
182 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3)
183 : "rcx", "r11", "memory");
184#elif defined(__i386__)
185 __asm__ __volatile__("int $0x30"
186 : "=a"(ret)
187 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3)
188 : "memory");
189#elif defined(__arm__)
190 register scarg r7 __thumb_r7 = syscall;
191 register scarg r0 __asm__("r0") = arg1;
192 register scarg r1 __asm__("r1") = arg2;
193 register scarg r2 __asm__("r2") = arg3;
194 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2));
195#elif defined(__aarch64__)
196 register scarg x8 __asm__("x8") = syscall;
197 register scarg x0 __asm__("x0") = arg1;
198 register scarg x1 __asm__("x1") = arg2;
199 register scarg x2 __asm__("x2") = arg3;
200 __asm__ __volatile__("svc 0"
201 : "=r"(ret)
202 : "r"(x8), "0"(x0), "r"(x1), "r"(x2)
203 : "memory", "cc");
204#else
205#error "Unsupported architecture"
206#endif
207 return ret;
208}
209
222static inline scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
223{
224 scarg ret;
225#if defined(__amd64__)
226 register scarg r10 __asm__("r10") = arg4;
227 __asm__ __volatile__("syscall"
228 : "=a"(ret)
229 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10)
230 : "rcx", "r11", "memory");
231#elif defined(__i386__)
232 __asm__ __volatile__("int $0x30"
233 : "=a"(ret)
234 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3), "S"(arg4)
235 : "memory");
236#elif defined(__arm__)
237 register scarg r7 __thumb_r7 = syscall;
238 register scarg r0 __asm__("r0") = arg1;
239 register scarg r1 __asm__("r1") = arg2;
240 register scarg r2 __asm__("r2") = arg3;
241 register scarg r3 __asm__("r3") = arg4;
242 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2), "r"(r3));
243#elif defined(__aarch64__)
244 register scarg x8 __asm__("x8") = syscall;
245 register scarg x0 __asm__("x0") = arg1;
246 register scarg x1 __asm__("x1") = arg2;
247 register scarg x2 __asm__("x2") = arg3;
248 register scarg x3 __asm__("x3") = arg4;
249 __asm__ __volatile__("svc 0"
250 : "=r"(ret)
251 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3)
252 : "memory", "cc");
253#else
254#error "Unsupported architecture"
255#endif
256 return ret;
257}
258
272static inline scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
273{
274 scarg ret;
275#if defined(__amd64__)
276 register scarg r10 __asm__("r10") = arg4;
277 register scarg r8 __asm__("r8") = arg5;
278 __asm__ __volatile__("syscall"
279 : "=a"(ret)
280 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8)
281 : "rcx", "r11", "memory");
282#elif defined(__i386__)
283 __asm__ __volatile__("int $0x30"
284 : "=a"(ret)
285 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3), "S"(arg4), "D"(arg5)
286 : "memory");
287#elif defined(__arm__)
288 register scarg r7 __thumb_r7 = syscall;
289 register scarg r0 __asm__("r0") = arg1;
290 register scarg r1 __asm__("r1") = arg2;
291 register scarg r2 __asm__("r2") = arg3;
292 register scarg r3 __asm__("r3") = arg4;
293 register scarg r4 __asm__("r4") = arg5;
294 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4));
295#elif defined(__aarch64__)
296 register scarg x8 __asm__("x8") = syscall;
297 register scarg x0 __asm__("x0") = arg1;
298 register scarg x1 __asm__("x1") = arg2;
299 register scarg x2 __asm__("x2") = arg3;
300 register scarg x3 __asm__("x3") = arg4;
301 register scarg x4 __asm__("x4") = arg5;
302 __asm__ __volatile__("svc 0"
303 : "=r"(ret)
304 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4)
305 : "memory", "cc");
306#else
307#error "Unsupported architecture"
308#endif
309 return ret;
310}
311
326static inline scarg syscall6(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5, scarg arg6)
327{
328 scarg ret;
329#if defined(__amd64__)
330 register scarg r10 __asm__("r10") = arg4;
331 register scarg r8 __asm__("r8") = arg5;
332 register scarg r9 __asm__("r9") = arg6;
333 __asm__ __volatile__("syscall"
334 : "=a"(ret)
335 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8), "r"(r9)
336 : "rcx", "r11", "memory");
337#elif defined(__i386__)
338 __asm__ __volatile__("int $0x30"
339 : "=a"(ret)
340 : "a"(syscall), "b"(arg1), "c"(arg2), "d"(arg3), "S"(arg4), "D"(arg5), "g"(arg6)
341 : "memory");
342#elif defined(__arm__)
343 register scarg r7 __thumb_r7 = syscall;
344 register scarg r0 __asm__("r0") = arg1;
345 register scarg r1 __asm__("r1") = arg2;
346 register scarg r2 __asm__("r2") = arg3;
347 register scarg r3 __asm__("r3") = arg4;
348 register scarg r4 __asm__("r4") = arg5;
349 register scarg r5 __asm__("r5") = arg6;
350 __arm_call(__r7_operand, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5));
351#elif defined(__aarch64__)
352 register scarg x8 __asm__("x8") = syscall;
353 register scarg x0 __asm__("x0") = arg1;
354 register scarg x1 __asm__("x1") = arg2;
355 register scarg x2 __asm__("x2") = arg3;
356 register scarg x3 __asm__("x3") = arg4;
357 register scarg x4 __asm__("x4") = arg5;
358 register scarg x5 __asm__("x5") = arg6;
359 __asm__ __volatile__("svc 0"
360 : "=r"(ret)
361 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5)
362 : "memory", "cc");
363#else
364#error "Unsupported architecture"
365#endif
366 return ret;
367}
368
369#pragma endregion Syscall Wrappers
370
378#define __SYS_NULL ((void *)0)
379
393
409
417
425#ifdef __kernel__
426typedef syscall_prctl_options_t prctl_options_t;
427#endif
428
435
436typedef enum
437{
439 /* Process abort signal. */
441 /* Alarm clock. */
443 /* Access to an undefined portion of a memory object. */
445 /* Child process terminated, stopped, or continued. */
447 /* Continue executing, if stopped. */
449 /* Erroneous arithmetic operation. */
451 /* Hangup. */
453 /* Illegal instruction. */
455 /* Terminal interrupt signal. */
457 /* Kill (cannot be caught or ignored). */
459 /* Write on a pipe with no one to read it. */
461 /* Terminal quit signal. */
463 /* Invalid memory reference. */
465 /* Stop executing (cannot be caught or ignored). */
467 /* Termination signal. */
469 /* Terminal stop signal. */
471 /* Background process attempting read. */
473 /* Background process attempting write. */
475 /* User-defined signal 1. */
477 /* User-defined signal 2. */
479 /* Pollable event. */
481 /* Profiling timer expired. */
483 /* Bad system call. */
485 /* Trace/breakpoint trap. */
487 /* High bandwidth data is available at a socket. */
489 /* Virtual timer expired. */
491 /* CPU time limit exceeded. */
493 /* File size limit exceeded. */
495
503
504 /* Real-time signals. */
538
539 /* Maximum signal number. */
542#ifdef __kernel__
543typedef syscall_signal_t signal_t;
544#endif
545
559#ifdef __kernel__
560typedef syscall_signal_disposition_t signal_disposition_t;
561#endif
562
569
580
587
595
596#ifndef __cplusplus
597_Static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
598#else
599static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
600#endif
601
602typedef int __SYS_clockid_t;
603typedef unsigned int __SYS_socklen_t;
604
606{
607 __UINT32_TYPE__ Width;
608 __UINT32_TYPE__ Height;
609 __UINT32_TYPE__ Pitch;
610 __UINT32_TYPE__ Bpp;
611 __UINT32_TYPE__ Size;
613
625#define FBIOGET_SCREEN_INFO 0xf0
626
1618
1619/* Initialization */
1620
1622#define call_api_version(version) syscall1(SYS_API_VERSION, (scarg)version)
1623
1624/* I/O */
1625
1627#define call_read(fd, buf, count) syscall3(SYS_READ, (scarg)fd, (scarg)buf, (scarg)count)
1628
1630#define call_pread(fd, buf, count, offset) syscall4(SYS_PREAD, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1631
1633#define call_write(fd, buf, count) syscall3(SYS_WRITE, (scarg)fd, (scarg)buf, (scarg)count)
1634
1636#define call_pwrite(fd, buf, count, offset) syscall4(SYS_PWRITE, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1637
1639#define call_open(pathname, flags, mode) syscall3(SYS_OPEN, (scarg)pathname, (scarg)flags, (scarg)mode)
1640
1642#define call_close(fd) syscall1(SYS_CLOSE, fd)
1643
1645#define call_ioctl(fd, request, argp) syscall3(SYS_IOCTL, (scarg)fd, (scarg)request, (scarg)argp)
1646
1647/* File Status */
1648
1650#define call_stat(pathname, statbuf) syscall2(SYS_STAT, (scarg)pathname, (scarg)statbuf)
1651
1653#define call_fstat(fd, statbuf) syscall2(SYS_FSTAT, (scarg)fd, (scarg)statbuf)
1654
1656#define call_lstat(pathname, statbuf) syscall2(SYS_LSTAT, (scarg)pathname, (scarg)statbuf)
1657
1659#define call_access(pathname, mode) syscall2(SYS_ACCESS, (scarg)pathname, (scarg)mode)
1660
1662#define call_truncate(pathname, length) syscall2(SYS_TRUNCATE, (scarg)pathname, (scarg)length)
1663
1665#define call_ftruncate(fd, length) syscall2(SYS_FTRUNCATE, (scarg)fd, (scarg)length)
1666
1668#define call_tell(fd) syscall1(SYS_TELL, (scarg)fd)
1669
1671#define call_seek(fd, offset, whence) syscall3(SYS_SEEK, (scarg)fd, (scarg)offset, (scarg)whence)
1672
1673/* Process Control */
1674
1676#define call_exit(status) syscall1(SYS_EXIT, (scarg)status)
1677
1679#define call_fork() syscall0(SYS_FORK)
1680
1682#define call_execve(pathname, argv, envp) syscall3(SYS_EXECVE, (scarg)pathname, (scarg)argv, (scarg)envp)
1683
1685#define call_getpid() syscall0(SYS_GETPID)
1686
1688#define call_getppid() syscall0(SYS_GETPPID)
1689
1691#define call_waitpid(pid, wstatus, options) syscall3(SYS_WAITPID, (scarg)pid, (scarg)wstatus, (scarg)options)
1692
1694#define call_kill(pid, sig) syscall2(SYS_KILL, (scarg)pid, (scarg)sig)
1695
1697#define call_prctl(option, arg1, arg2, arg3, arg4) syscall5(SYS_PRCTL, (scarg)option, (scarg)arg1, (scarg)arg2, (scarg)arg3, (scarg)arg4)
1698
1699/* Memory */
1700
1702#define call_brk(end_data) syscall1(SYS_BRK, (scarg)end_data)
1703
1705#define call_mmap(addr, length, prot, flags, fd, offset) syscall6(SYS_MMAP, (scarg)addr, (scarg)length, (scarg)prot, (scarg)flags, (scarg)fd, (scarg)offset)
1706
1708#define call_munmap(addr, length) syscall2(SYS_MUNMAP, (scarg)addr, (scarg)length)
1709
1711#define call_mprotect(addr, length, prot) syscall3(SYS_MPROTECT, (scarg)addr, (scarg)length, (scarg)prot)
1712
1714#define call_madvise(addr, length, advice) syscall3(SYS_MADVISE, (scarg)addr, (scarg)length, (scarg)advice)
1715
1716/* Communication */
1717
1719#define call_pipe(pipefd) syscall1(SYS_PIPE, (scarg)pipefd)
1720
1722#define call_dup(oldfd) syscall1(SYS_DUP, (scarg)oldfd)
1723
1725#define call_dup2(oldfd, newfd) syscall2(SYS_DUP2, (scarg)oldfd, (scarg)newfd)
1726
1728#define call_socket(domain, type, protocol) syscall3(SYS_SOCKET, (scarg)domain, (scarg)type, (scarg)protocol)
1729
1731#define call_bind(sockfd, addr, addrlen) syscall3(SYS_BIND, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1732
1734#define call_connect(sockfd, addr, addrlen) syscall3(SYS_CONNECT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1735
1737#define call_listen(sockfd, backlog) syscall2(SYS_LISTEN, (scarg)sockfd, (scarg)backlog)
1738
1740#define call_accept(sockfd, addr, addrlen) syscall3(SYS_ACCEPT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1741
1743#define call_send(sockfd, buf, len, flags) syscall4(SYS_SEND, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1744
1746#define call_recv(sockfd, buf, len, flags) syscall4(SYS_RECV, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1747
1749#define call_shutdown(sockfd, how) syscall2(SYS_SHUTDOWN, (scarg)sockfd, (scarg)how)
1750
1751/* Time */
1752
1754#define call_time(t) syscall1(SYS_TIME, t)
1755
1757#define call_clock_gettime(clockid, tp) syscall2(SYS_CLOCK_GETTIME, (scarg)clockid, (scarg)tp)
1758
1760#define call_clock_settime(clockid, tp) syscall2(SYS_CLOCK_SETTIME, (scarg)clockid, (scarg)tp)
1761
1763#define call_nanosleep(req, rem) syscall2(SYS_NANOSLEEP, (scarg)req, (scarg)rem)
1764
1765/* Miscellaneous */
1766
1768#define call_getcwd(buf, size) syscall2(SYS_GETCWD, (scarg)buf, (scarg)size)
1769
1771#define call_chdir(path) syscall1(SYS_CHDIR, (scarg)path)
1772
1774#define call_mkdir(path, mode) syscall2(SYS_MKDIR, (scarg)path, (scarg)mode)
1775
1777#define call_rmdir(path) syscall1(SYS_RMDIR, (scarg)path)
1778
1780#define call_unlink(pathname) syscall1(SYS_UNLINK, (scarg)pathname)
1781
1783#define call_rename(oldpath, newpath) syscall2(SYS_RENAME, (scarg)oldpath, (scarg)newpath)
1784
1785#endif // !__FENNIX_API_SYSCALLS_LIST_H__
syscall_signal_t
Definition syscalls.h:437
@ __SYS_SIGRTMAX
Definition syscalls.h:537
@ __SYS_SIGRT_11
Definition syscalls.h:516
@ __SYS_SIGRT_7
Definition syscalls.h:512
@ __SYS_SIGTTIN
Definition syscalls.h:472
@ __SYS_SIGUSR1
Definition syscalls.h:476
@ __SYS_SIGTSTP
Definition syscalls.h:470
@ __SYS_SIGTERM
Definition syscalls.h:468
@ __SYS_SIGPOLL
Definition syscalls.h:480
@ __SYS_SIGFPE
Definition syscalls.h:450
@ __SYS_SIGKILL
Definition syscalls.h:458
@ __SYS_SIGCOMP3
Definition syscalls.h:502
@ __SYS_SIGRT_29
Definition syscalls.h:534
@ __SYS_SIGRT_9
Definition syscalls.h:514
@ __SYS_SIGRT_1
Definition syscalls.h:506
@ __SYS_SIGRT_23
Definition syscalls.h:528
@ __SYS_SIGQUIT
Definition syscalls.h:462
@ __SYS_SIGURG
Definition syscalls.h:488
@ __SYS_SIGRT_15
Definition syscalls.h:520
@ __SYS_SIGBUS
Definition syscalls.h:444
@ __SYS_SIGTRAP
Definition syscalls.h:486
@ __SYS_SIGRT_3
Definition syscalls.h:508
@ __SYS_SIGRT_13
Definition syscalls.h:518
@ __SYS_SIGCOMP1
Definition syscalls.h:500
@ __SYS_SIGRT_4
Definition syscalls.h:509
@ __SYS_SIGRT_24
Definition syscalls.h:529
@ __SYS_SIGRT_17
Definition syscalls.h:522
@ __SYS_SIGNULL
Definition syscalls.h:438
@ __SYS_SIGCOMP2
Definition syscalls.h:501
@ __SYS_SIGABRT
Definition syscalls.h:440
@ __SYS_SIGRT_5
Definition syscalls.h:510
@ __SYS_SIGTTOU
Definition syscalls.h:474
@ __SYS_SIGNAL_MAX
Definition syscalls.h:540
@ __SYS_SIGALRM
Definition syscalls.h:442
@ __SYS_SIGRT_28
Definition syscalls.h:533
@ __SYS_SIGXFSZ
Definition syscalls.h:494
@ __SYS_SIGINT
Definition syscalls.h:456
@ __SYS_SIGSEGV
Definition syscalls.h:464
@ __SYS_SIGVTALRM
Definition syscalls.h:490
@ __SYS_SIGCONT
Definition syscalls.h:448
@ __SYS_SIGRT_30
Definition syscalls.h:535
@ __SYS_SIGSTOP
Definition syscalls.h:466
@ __SYS_SIGRT_25
Definition syscalls.h:530
@ __SYS_SIGRT_12
Definition syscalls.h:517
@ __SYS_SIGHUP
Definition syscalls.h:452
@ __SYS_SIGRTMIN
Definition syscalls.h:505
@ __SYS_SIGPIPE
Definition syscalls.h:460
@ __SYS_SIGXCPU
Definition syscalls.h:492
@ __SYS_SIGRT_20
Definition syscalls.h:525
@ __SYS_SIGRT_10
Definition syscalls.h:515
@ __SYS_SIGRT_26
Definition syscalls.h:531
@ __SYS_SIGRT_31
Definition syscalls.h:536
@ __SYS_SIGRT_16
Definition syscalls.h:521
@ __SYS_SIGRT_14
Definition syscalls.h:519
@ __SYS_SIGRT_18
Definition syscalls.h:523
@ __SYS_SIGRT_8
Definition syscalls.h:513
@ __SYS_SIGRT_2
Definition syscalls.h:507
@ __SYS_SIGSYS
Definition syscalls.h:484
@ __SYS_SIGRT_21
Definition syscalls.h:526
@ __SYS_SIGRT_22
Definition syscalls.h:527
@ __SYS_SIGCHLD
Definition syscalls.h:446
@ __SYS_SIGRT_19
Definition syscalls.h:524
@ __SYS_SIGRT_27
Definition syscalls.h:532
@ __SYS_SIGPROF
Definition syscalls.h:482
@ __SYS_SIGILL
Definition syscalls.h:454
@ __SYS_SIGUSR2
Definition syscalls.h:478
@ __SYS_SIGRT_6
Definition syscalls.h:511
syscall_open_flags_t
Definition syscalls.h:395
@ __SYS_O_RDWR
Definition syscalls.h:398
@ __SYS_O_DSYNC
Definition syscalls.h:401
@ __SYS_O_NONBLOCK
Definition syscalls.h:404
@ __SYS_O_RDONLY
Definition syscalls.h:396
@ __SYS_O_RSYNC
Definition syscalls.h:405
@ __SYS_O_WRONLY
Definition syscalls.h:397
@ __SYS_O_NOCTTY
Definition syscalls.h:403
@ __SYS_O_EXCL
Definition syscalls.h:402
@ __SYS_O_APPEND
Definition syscalls.h:399
@ __SYS_O_SYNC
Definition syscalls.h:406
@ __SYS_O_TRUNC
Definition syscalls.h:407
@ __SYS_O_CREAT
Definition syscalls.h:400
__UINT32_TYPE__ Width
Definition syscalls.h:607
syscall_seek_whence_t
Definition syscalls.h:430
@ __SYS_SEEK_CUR
Definition syscalls.h:432
@ __SYS_SEEK_SET
Definition syscalls.h:431
@ __SYS_SEEK_END
Definition syscalls.h:433
__UINT32_TYPE__ Height
Definition syscalls.h:608
syscall_access_flags_t
Definition syscalls.h:411
@ __SYS_X_OK
Definition syscalls.h:415
@ __SYS_R_OK
Definition syscalls.h:413
@ __SYS_F_OK
Definition syscalls.h:412
@ __SYS_W_OK
Definition syscalls.h:414
unsigned int __SYS_socklen_t
Definition syscalls.h:603
#define scarg
Definition syscalls.h:23
__UINT32_TYPE__ Pitch
Definition syscalls.h:609
syscall_signal_disposition_t
Definition syscalls.h:547
@ __SYS_SIG_TERM
Definition syscalls.h:549
@ __SYS_SIG_STOP
Definition syscalls.h:555
@ __SYS_SIG_CORE
Definition syscalls.h:557
@ __SYS_SIG_CONT
Definition syscalls.h:553
@ __SYS_SIG_IGN
Definition syscalls.h:551
syscalls_t
List of syscalls.
Definition syscalls.h:634
@ SYS_UNLINK
Remove a file.
Definition syscalls.h:1585
@ SYS_MMAP
Map files or devices into memory.
Definition syscalls.h:1174
@ SYS_SHUTDOWN
Shut down part of a full-duplex connection.
Definition syscalls.h:1427
@ SYS_RECV
Receive data on a socket.
Definition syscalls.h:1410
@ SYS_MAX
Max number of syscalls.
Definition syscalls.h:1616
@ SYS_STAT
Retrieve file status.
Definition syscalls.h:835
@ SYS_WRITE
Write to a file descriptor.
Definition syscalls.h:724
@ SYS_NANOSLEEP
Sleep for a specified time.
Definition syscalls.h:1497
@ SYS_TELL
Get the current file offset.
Definition syscalls.h:951
@ SYS_TRUNCATE
Change the size of a file.
Definition syscalls.h:917
@ SYS_PIPE
Create a pipe.
Definition syscalls.h:1249
@ SYS_RMDIR
Remove an empty directory.
Definition syscalls.h:1568
@ SYS_READ
Read from a file descriptor.
Definition syscalls.h:681
@ SYS_GETPPID
Get the parent process ID.
Definition syscalls.h:1055
@ SYS_CLOSE
Close a file descriptor.
Definition syscalls.h:795
@ SYS_MADVISE
Provide advice about memory usage.
Definition syscalls.h:1229
@ SYS_EXECVE
Execute a program.
Definition syscalls.h:1029
@ SYS_LISTEN
Listen for incoming connections on a socket.
Definition syscalls.h:1354
@ SYS_WAITPID
Wait for a child process to change state.
Definition syscalls.h:1073
@ SYS_BRK
Set the program break.
Definition syscalls.h:1131
@ SYS_MUNMAP
Unmap a mapped memory region.
Definition syscalls.h:1192
@ SYS_EXIT
Terminate the calling process.
Definition syscalls.h:993
@ SYS_OPEN
Open a file.
Definition syscalls.h:779
@ SYS_CONNECT
Connect to a remote address.
Definition syscalls.h:1337
@ SYS_IOCTL
Control a device.
Definition syscalls.h:814
@ SYS_PREAD
Read from a file descriptor.
Definition syscalls.h:703
@ SYS_RENAME
Rename a file or directory.
Definition syscalls.h:1603
@ SYS_GETPID
Get the process ID of the calling process.
Definition syscalls.h:1042
@ SYS_FSTAT
Retrieve file status for an open file descriptor.
Definition syscalls.h:853
@ SYS_PWRITE
Write to a file descriptor.
Definition syscalls.h:745
@ SYS_BIND
Bind a socket to a local address.
Definition syscalls.h:1319
@ SYS_TIME
Get the current time.
Definition syscalls.h:1446
@ SYS_DUP
Duplicate a file descriptor.
Definition syscalls.h:1265
@ SYS_SOCKET
Create an endpoint for communication.
Definition syscalls.h:1301
@ SYS_CLOCK_SETTIME
Set the current time of a specific clock.
Definition syscalls.h:1480
@ SYS_API_VERSION
Set syscall version.
Definition syscalls.h:657
@ SYS_FORK
Create a child process.
Definition syscalls.h:1009
@ SYS_SEND
Send data on a socket.
Definition syscalls.h:1391
@ SYS_PRCTL
Process/Thread Control.
Definition syscalls.h:1112
@ SYS_LSTAT
Retrieve file status with symbolic link resolution.
Definition syscalls.h:872
@ SYS_DUP2
Duplicate a file descriptor to a specific value.
Definition syscalls.h:1283
@ SYS_KILL
Send a signal to a process.
Definition syscalls.h:1091
@ SYS_MPROTECT
Change memory protection.
Definition syscalls.h:1210
@ SYS_MKDIR
Create a new directory.
Definition syscalls.h:1552
@ SYS_CHDIR
Change the current working directory.
Definition syscalls.h:1534
@ SYS_ACCEPT
Accept an incoming connection on a socket.
Definition syscalls.h:1372
@ SYS_FTRUNCATE
Change the size of a file referred by a file descriptor.
Definition syscalls.h:935
@ SYS_SEEK
Set the file offset.
Definition syscalls.h:975
@ SYS_GETCWD
Get the current working directory.
Definition syscalls.h:1517
@ SYS_CLOCK_GETTIME
Get the current time of a specific clock.
Definition syscalls.h:1463
@ SYS_ACCESS
Check a file's accessibility.
Definition syscalls.h:898
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:326
syscall_clockid_t
Definition syscalls.h:589
@ __SYS_CLOCK_PROCESS_CPUTIME_ID
Definition syscalls.h:591
@ __SYS_CLOCK_REALTIME
Definition syscalls.h:592
@ __SYS_CLOCK_THREAD_CPUTIME_ID
Definition syscalls.h:593
@ __SYS_CLOCK_MONOTONIC
Definition syscalls.h:590
syscall_mmap_flags_t
Definition syscalls.h:381
@ __SYS_MAP_ANON
Definition syscalls.h:391
@ __SYS_PROT_NONE
Definition syscalls.h:385
@ __SYS_PROT_READ
Definition syscalls.h:382
@ __SYS_MAP_FIXED
Definition syscalls.h:389
@ __SYS_MAP_SHARED
Definition syscalls.h:387
@ __SYS_PROT_EXEC
Definition syscalls.h:384
@ __SYS_PROT_WRITE
Definition syscalls.h:383
@ __SYS_MAP_PRIVATE
Definition syscalls.h:388
@ __SYS_MAP_ANONYMOUS
Definition syscalls.h:390
syscall_prctl_options_t
Definition syscalls.h:419
@ __SYS_GET_FS
Definition syscalls.h:422
@ __SYS_SET_GS
Definition syscalls.h:421
@ __SYS_GET_GS
Definition syscalls.h:420
@ __SYS_SET_FS
Definition syscalls.h:423
static scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
Syscall wrapper with 5 arguments.
Definition syscalls.h:272
__UINT32_TYPE__ Bpp
Definition syscalls.h:610
static scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
Syscall wrapper with 4 arguments.
Definition syscalls.h:222
static scarg syscall1(scarg syscall, scarg arg1)
Syscall wrapper with 1 argument.
Definition syscalls.h:93
syscall_signal_actions_t
Definition syscalls.h:564
@ __SYS_SIG_UNBLOCK
Definition syscalls.h:566
@ __SYS_SIG_SETMASK
Definition syscalls.h:567
@ __SYS_SIG_BLOCK
Definition syscalls.h:565
static scarg syscall0(scarg syscall)
Syscall wrapper with 0 arguments.
Definition syscalls.h:54
syscall_signal_action_flags_t
Definition syscalls.h:571
@ __SYS_SA_SIGINFO
Definition syscalls.h:576
@ __SYS_SA_RESTART
Definition syscalls.h:575
@ __SYS_SA_RESETHAND
Definition syscalls.h:574
@ __SYS_SA_ONSTACK
Definition syscalls.h:573
@ __SYS_SA_NODEFER
Definition syscalls.h:578
@ __SYS_SA_NOCLDSTOP
Definition syscalls.h:572
@ __SYS_SA_NOCLDWAIT
Definition syscalls.h:577
static scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
Syscall wrapper with 2 arguments.
Definition syscalls.h:133
syscall_signal_action_disposition_t
Definition syscalls.h:582
@ __SYS_SIG_ERR
Definition syscalls.h:583
@ ___SYS_SIG_IGN
Definition syscalls.h:585
@ __SYS_SIG_DFL
Definition syscalls.h:584
static scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
Syscall wrapper with 3 arguments.
Definition syscalls.h:176
__UINT32_TYPE__ Size
Definition syscalls.h:611
int __SYS_clockid_t
Definition syscalls.h:602