fbcf46edb524fe3b3a089f83bf49172c688de167
[akaros.git] / kern / include / ros / syscall.h
1 #ifndef ROS_INCLUDE_SYSCALL_H
2 #define ROS_INCLUDE_SYSCALL_H
3
4 /* system call numbers.  need to #def them for use in assembly. */
5 #define SYS_null                                         1
6 #define SYS_cache_buster                         2
7 #define SYS_cache_invalidate             3
8 #define SYS_reboot                                       4
9 #define SYS_cputs                                        5
10 #define SYS_cgetc                                        6
11 #define SYS_getcpuid                             7
12 #define SYS_getvcoreid                           8
13 #define SYS_getpid                                       9
14 #define SYS_proc_create                         10
15 #define SYS_proc_run                            11
16 #define SYS_proc_destroy                        12
17 #define SYS_yield                                       13
18 #define SYS_run_binary                          14
19 #define SYS_fork                                        15
20 #define SYS_exec                                        16
21 #define SYS_trywait                                     17
22 #define SYS_mmap                                        18
23 #define SYS_munmap                                      19
24 #define SYS_mprotect                            20
25 /* // these are the other mmap related calls, some of which we'll implement
26 #define SYS_mincore // can read page tables instead
27 #define SYS_madvise
28 #define SYS_mlock
29 #define SYS_msync
30 */
31 #define SYS_brk                                         21
32 #define SYS_shared_page_alloc           22
33 #define SYS_shared_page_free            23
34 #define SYS_resource_req                        24
35 /* Platform specific syscalls */
36 #define SYS_serial_read                         25
37 #define SYS_serial_write                        26
38 #define SYS_eth_read                            27
39 #define SYS_eth_write                           28
40 #define SYS_eth_get_mac_addr                    29
41 #define SYS_eth_recv_check                      30
42
43 #define SYS_read                                100
44 #define SYS_write                               101
45 #define SYS_open                                102
46 #define SYS_close                               103
47 #define SYS_fstat                               104
48 #define SYS_stat                                105
49 #define SYS_lstat                               106
50 #define SYS_fcntl                               107
51 #define SYS_access                              108
52 #define SYS_umask                               109
53 #define SYS_chmod                               110
54 #define SYS_lseek                               111
55 #define SYS_link                                112
56 #define SYS_unlink                              113
57 #define SYS_chdir                               114
58 #define SYS_getcwd                              115
59 #define SYS_gettimeofday                116
60 #define SYS_tcgetattr                   117
61 #define SYS_tcsetattr                   118
62
63 /* For Buster Measurement Flags */
64 #define BUSTER_SHARED                   0x0001
65 #define BUSTER_STRIDED                  0x0002
66 #define BUSTER_LOCKED                   0x0004
67 #define BUSTER_PRINT_TICKS              0x0008
68 #define BUSTER_JUST_LOCKS               0x0010 // unimplemented
69
70 // for system calls that pass filenames
71 #define MAX_PATH_LEN 256
72
73 // convenience wrapper for __ros_syscall
74 #define ros_syscall(which,a0,a1,a2,a3,a4) \
75    __ros_syscall(which,(long)(a0),(long)(a1),(long)(a2),(long)(a3),(long)(a4))
76 #include <ros/arch/syscall.h>
77
78 #endif /* !ROS_INCLUDE_SYSCALL_H */