11#define _SYSCALL0(retType, num) \
13 register retType ret asm("rax"); \
14 ASM("syscall\n" : "=a"(ret) : "a"(num) : "rcx", "r11", "memory"); \
18#define _SYSCALL1(retType, num, type1, arg1) \
20 register retType ret asm("rax"); \
21 register type1 _a1 asm("rdi") = (arg1); \
22 ASM("syscall\n" : "=a"(ret) : "a"(num), "r"(_a1) : "rcx", "r11", "memory"); \
26#define _SYSCALL2(retType, num, type1, arg1, type2, arg2) \
28 register retType ret asm("rax"); \
29 register type1 _a1 asm("rdi") = (arg1); \
30 register type2 _a2 asm("rsi") = (arg2); \
31 ASM("syscall\n" : "=a"(ret) : "a"(num), "r"(_a1), "r"(_a2) : "rcx", "r11", "memory"); \
35#define _SYSCALL3(retType, num, type1, arg1, type2, arg2, type3, arg3) \
37 register retType ret asm("rax"); \
38 register type1 _a1 asm("rdi") = (arg1); \
39 register type2 _a2 asm("rsi") = (arg2); \
40 register type3 _a3 asm("rdx") = (arg3); \
41 ASM("syscall\n" : "=a"(ret) : "a"(num), "r"(_a1), "r"(_a2), "r"(_a3) : "rcx", "r11", "memory"); \
45#define _SYSCALL4(retType, num, type1, arg1, type2, arg2, type3, arg3, type4, arg4) \
47 register retType ret asm("rax"); \
48 register type1 _a1 asm("rdi") = (arg1); \
49 register type2 _a2 asm("rsi") = (arg2); \
50 register type3 _a3 asm("rdx") = (arg3); \
51 register type4 _a4 asm("r10") = (arg4); \
52 ASM("syscall\n" : "=a"(ret) : "a"(num), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4) : "rcx", "r11", "memory"); \
56#define _SYSCALL5(retType, num, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5) \
58 register retType ret asm("rax"); \
59 register type1 _a1 asm("rdi") = (arg1); \
60 register type2 _a2 asm("rsi") = (arg2); \
61 register type3 _a3 asm("rdx") = (arg3); \
62 register type4 _a4 asm("r10") = (arg4); \
63 register type5 _a5 asm("r8") = (arg5); \
64 ASM("syscall\n" : "=a"(ret) : "a"(num), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4), "r"(_a5) : "rcx", "r11", \
69#define _SYSCALL6(retType, num, type1, arg1, type2, arg2, type3, arg3, type4, arg4, type5, arg5, type6, arg6) \
71 register retType ret asm("rax"); \
72 register type1 _a1 asm("rdi") = (arg1); \
73 register type2 _a2 asm("rsi") = (arg2); \
74 register type3 _a3 asm("rdx") = (arg3); \
75 register type4 _a4 asm("r10") = (arg4); \
76 register type5 _a5 asm("r8") = (arg5); \
77 register type6 _a6 asm("r9") = (arg6); \
78 ASM("syscall\n" : "=a"(ret) : "a"(num), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4), "r"(_a5), "r"(_a6) : "rcx", \
87 __builtin_unreachable();
94 __builtin_unreachable();
261 __builtin_unreachable();
EFI_PHYSICAL_ADDRESS buffer
static clock_source_t source
Structure to describe the HPET to the sys time subsystem.
static uintptr_t address
Mapped virtual address of the HPET registers.
#define ASM(...)
Inline assembly macro.
uint8_t seek_origin_t
Type for the seek() origin argument.
uint64_t ioring_id_t
I/O ring ID type.
void(* note_func_t)(char *note)
Note handler function type.
futex_op_t
Futex operation enum.
arch_prctl_t
Architecture specific thread data codes.
spawn_flags_t
Spawn behaviour flags.
prot_t
Memory protection flags.
__INT64_TYPE__ ssize_t
Signed size type.
__UINT64_TYPE__ tid_t
Thread Identifier.
__UINT64_TYPE__ fd_t
File descriptor type.
__UINT64_TYPE__ pid_t
Process Identifier.
__UINT64_TYPE__ clock_t
A nanosecond time.
static const path_flag_t flags[]
__UINTPTR_TYPE__ uintptr_t
Poll file descriptor structure.
static fd_t _syscall_dup2(fd_t oldFd, fd_t newFd)
static uint64_t _syscall_ioctl(fd_t fd, uint64_t request, void *argp, size_t size)
static uint64_t _syscall_enter(ioring_id_t id, size_t amount, size_t wait)
static uint64_t _syscall_bind(const char *mountpoint, fd_t source)
#define _SYSCALL4(retType, num, type1, arg1, type2, arg2, type3, arg3, type4, arg4)
static uint64_t _syscall_teardown(ioring_id_t id)
static pid_t _syscall_getpid(void)
#define _SYSCALL3(retType, num, type1, arg1, type2, arg2, type3, arg3)
#define _SYSCALL1(retType, num, type1, arg1)
static uint64_t _syscall_remove(const char *path)
#define _SYSCALL0(retType, num)
static uint64_t _syscall_getdents(fd_t fd, dirent_t *buffer, uint64_t count)
static uint64_t _syscall_link(const char *oldPath, const char *newPath)
static _NORETURN void _syscall_thread_exit(void)
static uint64_t _syscall_mount(const char *mountpoint, const char *fs, const char *options)
static uint64_t _syscall_arch_prctl(arch_prctl_t code, uintptr_t addr)
static tid_t _syscall_thread_create(void *entry, void *arg)
static fd_t _syscall_open(const char *path)
static uint64_t _syscall_umount(const char *mountpoint)
static clock_t _syscall_uptime(void)
static void * _syscall_munmap(void *address, size_t length)
static void * _syscall_mprotect(void *address, size_t length, prot_t prot)
static uint64_t _syscall_share(char *key, uint64_t size, fd_t fd, clock_t timeout)
static _NORETURN void _syscall_exits(const char *status)
static _NORETURN uint64_t _syscall_noted(void)
static uint64_t _syscall_nanosleep(clock_t nanoseconds)
static tid_t _syscall_gettid(void)
static uint64_t _syscall_seek(fd_t fd, ssize_t offset, seek_origin_t origin)
#define _SYSCALL2(retType, num, type1, arg1, type2, arg2)
static pid_t _syscall_spawn(const char **argv, spawn_flags_t flags)
static uint64_t _syscall_open2(const char *path, fd_t fds[2])
static fd_t _syscall_dup(fd_t oldFd)
static uint64_t _syscall_close(fd_t fd)
static uint64_t _syscall_setup(ioring_t *ring, void *address, size_t sentries, size_t centries)
static uint64_t _syscall_stat(const char *path, stat_t *info)
static void _syscall_yield(void)
static errno_t _syscall_errno(void)
static uint64_t _syscall_symlink(const char *target, const char *linkpath)
static uint64_t _syscall_poll(pollfd_t *fds, uint64_t amount, clock_t timeout)
static fd_t _syscall_openat(fd_t from, const char *path)
static uint64_t _syscall_readlink(const char *path, char *buffer, uint64_t size)
static time_t _syscall_unix_epoch(void)
static uint64_t _syscall_read(fd_t fd, void *buffer, size_t count)
static uint64_t _syscall_write(fd_t fd, const void *buffer, size_t count)
static uint64_t _syscall_futex(atomic_uint64_t *addr, uint64_t val, futex_op_t op, clock_t timeout)
static void * _syscall_mmap(fd_t fd, void *address, size_t length, prot_t prot)
static uint64_t _syscall_notify(note_func_t func)
static fd_t _syscall_claim(const char *key)
long long unsigned time_t