akaros/kern/include/ros/bits/syscall.h
<<
>>
Prefs
   1#pragma once
   2
   3/* system call numbers.  need to #def them for use in assembly.  Removing
   4 * useless ones is okay, but if we change a number, we'll need to rebuild
   5 * userspace (which is why we have holes). */
   6#define SYS_null                 1
   7#define SYS_block                2
   8#define SYS_cache_invalidate     3
   9#define SYS_reboot               4
  10/* was SYS_cputs                 5 */
  11/* was SYS_cgetc                 6 */
  12#define SYS_getpcoreid           7
  13#define SYS_getvcoreid           8
  14/* was #define SYS_getpid        9 */
  15#define SYS_proc_create         10
  16#define SYS_proc_run            11
  17#define SYS_proc_destroy        12
  18#define SYS_proc_yield          13
  19#define SYS_change_vcore        14
  20#define SYS_fork                15
  21#define SYS_exec                16
  22#define SYS_waitpid             17
  23#define SYS_mmap                18
  24#define SYS_munmap              19
  25#define SYS_mprotect            20
  26/* was SYS_brk                  21 */
  27#define SYS_shared_page_alloc   22
  28#define SYS_shared_page_free    23
  29#define SYS_provision           24
  30#define SYS_notify              25
  31#define SYS_self_notify         26
  32#define SYS_halt_core           27
  33#define SYS_init_arsc           28
  34#define SYS_change_to_m         29
  35#define SYS_poke_ksched         30
  36#define SYS_abort_sysc          31
  37#define SYS_populate_va         32
  38#define SYS_abort_sysc_fd       33
  39#define SYS_vmm_add_gpcs        34
  40#define SYS_vc_entry            35
  41#define SYS_nanosleep           36
  42#define SYS_pop_ctx             37
  43#define SYS_vmm_poke_guest      38
  44#define SYS_send_event          39
  45#define SYS_vmm_ctl             40
  46
  47/* FS Syscalls */
  48#define SYS_read                100
  49#define SYS_write               101
  50#define SYS_openat              102
  51#define SYS_close               103
  52#define SYS_fstat               104
  53#define SYS_stat                105
  54#define SYS_lstat               106
  55#define SYS_fcntl               107
  56#define SYS_access              108
  57#define SYS_umask               109
  58/* was SYS_chmod                110 */
  59#define SYS_llseek              111
  60#define SYS_link                112
  61#define SYS_unlink              113
  62#define SYS_symlink             114
  63#define SYS_readlink            115
  64#define SYS_chdir               116
  65#define SYS_getcwd              117
  66#define SYS_mkdir               118
  67#define SYS_rmdir               119
  68/* was SYS_pipe                 120 */
  69
  70#define SYS_wstat               121
  71#define SYS_fwstat              122
  72#define SYS_rename              123
  73#define SYS_fchdir              124
  74#define SYS_dup_fds_to          125
  75#define SYS_tap_fds             126
  76
  77/* Misc syscalls */
  78/* was #define SYS_gettimeofday 140 */
  79#define SYS_tcgetattr           141
  80#define SYS_tcsetattr           142
  81#define SYS_setuid              143
  82#define SYS_setgid              144
  83
  84/* hotness! */
  85#define SYS_nbind               145
  86#define SYS_nmount              146
  87#define SYS_nunmount            147
  88/* was SYS_something            148 */
  89#define SYS_fd2path             149
  90
  91#define MAX_SYSCALL_NR          200
  92
  93// for system calls that pass filenames
  94#define MAX_PATH_LEN 256
  95
  96/* wstat flags, so the kernel knows what M fields to look at */
  97#define WSTAT_MODE              0x001
  98#define WSTAT_ATIME             0x002
  99#define WSTAT_MTIME             0x004
 100#define WSTAT_LENGTH            0x008
 101#define WSTAT_NAME              0x010
 102#define WSTAT_UID               0x020
 103#define WSTAT_GID               0x040
 104#define WSTAT_MUID              0x080
 105