added sparc newlib backend
[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_getpid,
21         SYS_proc_destroy,
22         SYS_shared_page_alloc,
23         SYS_shared_page_free,
24         SYS_yield,
25         SYS_proc_create,
26         SYS_proc_run,
27         SYS_frontend,           // forward a syscall to front-end machine
28
29         SYS_endofcalls //Should always be last
30 };
31 #define NSYSCALLS (SYS_endofcalls -1)
32 // syscall number starts at 1 and goes up to NSYSCALLS, without holes.
33 #define INVALID_SYSCALL(syscallno) ((syscallno) > NSYSCALLS)
34
35 /* For Buster Measurement Flags */
36 #define BUSTER_SHARED                   0x0001
37 #define BUSTER_STRIDED                  0x0002
38 #define BUSTER_LOCKED                   0x0004
39 #define BUSTER_PRINT_TICKS              0x0008
40 #define BUSTER_JUST_LOCKS               0x0010 // unimplemented
41
42 #define NUM_SYSCALL_ARGS 6
43 typedef struct syscall_req {
44         uint32_t num;
45         uint32_t flags;
46         uint32_t args[NUM_SYSCALL_ARGS];
47 } syscall_req_t;
48
49 typedef struct syscall_rsp {
50         int32_t retval;
51 } syscall_rsp_t;
52
53 // Generic Syscall Ring Buffer
54 DEFINE_RING_TYPES(syscall, syscall_req_t, syscall_rsp_t);
55
56 #endif /* !ROS_INCLUDE_SYSCALL_H */