8#if defined(__cplusplus)
43#define PRIORITY_MAX 63
44#define PRIORITY_MAX_USER 31
107#define BYTES_TO_PAGES(amount) (((amount) + PAGE_SIZE - 1) / PAGE_SIZE)
115#define PAGE_SIZE_OF(object) BYTES_TO_PAGES(sizeof(object))
203#define FUTEX_ALL UINT64_MAX
361#if defined(__cplusplus)
static uintptr_t address
Mapped virtual address of the HPET registers.
void * mprotect(void *address, size_t length, prot_t prot)
System call to change the protection flags of memory.
atnotify_t
Action type for atnotify().
void(* note_func_t)(char *note)
Note handler function type.
futex_op_t
Futex operation enum.
_NORETURN void exits(const char *status)
System call that handles pending notes for the current thread.
arch_prctl_t
Architecture specific thread data codes.
void * mmap(fd_t fd, void *address, size_t length, prot_t prot)
System call to map memory from a file.
uint64_t(* atnotify_func_t)(char *note)
User space atnotify() handler function type.
tid_t gettid(void)
System call to retrieve the current tid.
uint64_t futex(atomic_uint64_t *addr, uint64_t val, futex_op_t op, clock_t timeout)
System call for fast user space mutual exclusion.
int64_t wordcmp(const char *string, const char *word)
Helper for comparing the first word of a string.
spawn_flags_t
Spawn behaviour flags.
pid_t spawn(const char **argv, spawn_flags_t flags)
System call for spawning new processes.
uint64_t kill(pid_t pid)
Helper for sending the "kill" command to a process.
uint64_t arch_prctl(arch_prctl_t op, uintptr_t addr)
System call for setting architecture specific thread data.
uint64_t atnotify(atnotify_func_t handler, atnotify_t action)
Adds or removes a handler to be called in user space when a note is received.
uint64_t notify(note_func_t handler)
System call that sets the handler to be called when a note is received.
clock_t uptime(void)
System call for retreving the time since boot.
prot_t
Memory protection flags.
pid_t getpid(void)
System call to retrieve the current pid.
uint8_t priority_t
Priority type.
uint64_t nanosleep(clock_t timeout)
System call for sleeping.
void * munmap(void *address, size_t length)
System call to unmap mapped memory.
_NORETURN void noted(void)
System call that notifies the kernel that the current note has been handled.
@ FUTEX_WAKE
Wake up one or more threads waiting on the futex.
@ FUTEX_WAIT
Wait until the timeout expires or the futex value changes.
@ ARCH_GET_FS
Get the FS base address.
@ ARCH_SET_FS
Set the FS base address.
@ SPAWN_EMPTY_GROUP
Don't inherit the parent's process group, instead create a new group.
@ SPAWN_EMPTY_FDS
Dont inherit the file descriptors of the parent process.
@ SPAWN_DEFAULT
Default spawn behaviour.
@ SPAWN_EMPTY_ALL
Empty all inheritable resources.
@ SPAWN_STDIO_FDS
Only inherit stdin, stdout and stderr from the parent process.
@ SPAWN_EMPTY_NS
Create a new empty namespace, the new namespace will not contain any mountpoints or even a root.
@ SPAWN_COPY_NS
Don't share the parent's namespace, instead create a new copy of it.
@ SPAWN_EMPTY_ENV
Don't inherit the parent's environment variables.
@ SPAWN_EMPTY_CWD
Don't inherit the parent's current working directory, starts at root (/).
@ PROT_READ
Readable memory.
@ PROT_EXECUTE
Executable memory.
@ PROT_WRITE
Writable memory.
@ PROT_NONE
Invalid memory, cannot be accessed.
__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
atomic_uint64_t value
The value of the sync object.