Merge branch 'master' into net-dev
[akaros.git] / kern / include / ros / syscall.h
1 #ifndef ROS_INCLUDE_SYSCALL_H
2 #define ROS_INCLUDE_SYSCALL_H
3
4 #include <arch/types.h>
5 #include <ros/ring_buffer.h>
6
7 /* system call numbers */
8 enum
9 {
10         SYS_begofcalls, //Should always be first
11
12         SYS_null,
13         SYS_cache_buster,
14         SYS_cache_invalidate,
15         SYS_cputs,
16         SYS_cgetc,
17         SYS_getcpuid,
18         SYS_serial_write,
19         SYS_serial_read,
20         SYS_eth_read,
21         SYS_eth_write,
22         SYS_run_binary,
23         SYS_shared_page_alloc,
24         SYS_shared_page_free,
25         SYS_getenvid,
26         SYS_env_destroy,
27         SYS_yield,
28         SYS_proc_create,
29         SYS_proc_run,
30
31         SYS_endofcalls //Should always be last
32 };
33 #define NSYSCALLS (SYS_endofcalls -1)
34 // syscall number starts at 1 and goes up to NSYSCALLS, without holes.
35 #define INVALID_SYSCALL(syscallno) ((syscallno) > NSYSCALLS)
36
37 /* For Buster Measurement Flags */
38 #define BUSTER_SHARED                   0x0001
39 #define BUSTER_STRIDED                  0x0002
40 #define BUSTER_LOCKED                   0x0004
41 #define BUSTER_PRINT_TICKS              0x0008
42 #define BUSTER_JUST_LOCKS               0x0010 // unimplemented
43
44 #define NUM_SYSCALL_ARGS 6
45 typedef struct syscall_req {
46         uint32_t num;
47         uint32_t flags;
48         uint32_t args[NUM_SYSCALL_ARGS];
49 } syscall_req_t;
50
51 typedef struct syscall_rsp {
52         int32_t retval;
53 } syscall_rsp_t;
54
55 // Generic Syscall Ring Buffer
56 DEFINE_RING_TYPES(syscall, syscall_req_t, syscall_rsp_t);
57
58 #endif /* !ROS_INCLUDE_SYSCALL_H */