dcc7ec458e8086d99d785b47eab4e0087fd9f009
[akaros.git] / 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_getenvid,
18         SYS_getcpuid,
19         SYS_env_destroy,
20         SYS_serial_write,
21         SYS_serial_read,
22         SYS_eth_read,
23         SYS_eth_write,
24
25         SYS_endofcalls //Should always be last
26 };
27 #define NSYSCALLS (SYS_endofcalls -1)
28 // syscall number starts at 1 and goes up to NSYSCALLS, without holes.
29 #define INVALID_SYSCALL(syscallno) ((syscallno) > NSYSCALLS)
30
31 /* For Buster Measurement Flags */
32 #define BUSTER_SHARED                   0x0001
33 #define BUSTER_STRIDED                  0x0002
34 #define BUSTER_LOCKED                   0x0004
35 #define BUSTER_PRINT_TICKS              0x0008
36 #define BUSTER_JUST_LOCKS               0x0010 // unimplemented
37
38 #define NUM_SYS_ARGS 6
39 typedef struct syscall_req {
40         uint32_t num;
41         uint32_t flags;
42         uint32_t args[NUM_SYS_ARGS];
43 } syscall_req_t;
44
45 typedef struct syscall_rsp {
46         int32_t retval;
47 } syscall_rsp_t;
48
49 // Generic Syscall Ring Buffer
50 DEFINE_RING_TYPES(syscall, syscall_req_t, syscall_rsp_t);
51
52 #endif /* !ROS_INCLUDE_SYSCALL_H */