PatchworkOS  da8a090
A non-POSIX operating system.
Loading...
Searching...
No Matches
syscall.h File Reference
Include dependency graph for syscall.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  syscall_ctx_t
 Per thread syscall context. More...
 
struct  syscall_descriptor_t
 A syscall descriptor. More...
 

Macros

#define SYSCALL_DEFINE(num, returnType, ...)
 Macro to define a syscall.
 

Enumerations

enum  syscall_number_t {
  SYS_PROCESS_EXIT = 0 , SYS_THREAD_EXIT = 1 , SYS_SPAWN = 2 , SYS_NANOSLEEP = 3 ,
  SYS_ERRNO = 4 , SYS_GETPID = 5 , SYS_GETTID = 6 , SYS_UPTIME = 7 ,
  SYS_UNIX_EPOCH = 8 , SYS_OPEN = 9 , SYS_OPEN2 = 10 , SYS_CLOSE = 11 ,
  SYS_READ = 12 , SYS_WRITE = 13 , SYS_SEEK = 14 , SYS_IOCTL = 15 ,
  SYS_CHDIR = 16 , SYS_POLL = 17 , SYS_STAT = 18 , SYS_MMAP = 19 ,
  SYS_MUNMAP = 20 , SYS_MPROTECT = 21 , SYS_GETDENTS = 22 , SYS_THREAD_CREATE = 23 ,
  SYS_YIELD = 24 , SYS_DUP = 25 , SYS_DUP2 = 26 , SYS_FUTEX = 27 ,
  SYS_REMOVE = 28 , SYS_LINK = 29 , SYS_SHARE = 30 , SYS_CLAIM = 31 ,
  SYS_BIND = 32 , SYS_OPENAT = 33 , SYS_TOTAL_AMOUNT = 34
}
 System Call Numbers. More...
 

Functions

void syscall_ctx_init (syscall_ctx_t *ctx, const stack_pointer_t *syscallStack)
 Initialize a syscall context.
 
void syscall_ctx_load (syscall_ctx_t *ctx)
 Load the syscall context into the MSR_KERNEL_GS_BASE MSR.
 
void syscall_table_init (void)
 Sort the syscall table and verify that all syscalls are present.
 
void syscalls_cpu_init (void)
 Initialize syscalls on the current CPU.
 
uint64_t syscall_handler (uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t number)
 Main C syscall handler.
 
void syscall_entry (void)
 Assembly entry point for syscalls.
 

Variables

syscall_descriptor_t _syscallTableStart []
 Linker defined start of the syscall table.
 
syscall_descriptor_t _syscallTableEnd []
 Linker defined end of the syscall table.