sys_read(), sys_write(), and sys_lseek()
[akaros.git] / kern / include / syscall.h
1 #ifndef ROS_KERN_SYSCALL_H
2 #define ROS_KERN_SYSCALL_H
3 #ifndef ROS_KERNEL
4 # error "This is ROS kernel header; user programs should not #include it"
5 #endif
6
7 #include <ros/syscall.h>
8 #include <process.h>
9
10 #define SYSTRACE_ON                                     0x01
11 #define SYSTRACE_LOUD                           0x02
12 #define SYSTRACE_ALLPROC                        0x04
13
14 #define MAX_NUM_TRACED                          10
15 #define MAX_SYSTRACES                           1024
16
17 /* Consider cache aligning this */
18 struct systrace_record {
19         uint64_t                timestamp;
20         uintreg_t               syscallno;
21         int                             pid;
22         uint32_t                coreid;
23         uint32_t                vcoreid;
24 };
25
26 intreg_t syscall(struct proc *p, uintreg_t num, uintreg_t a1, uintreg_t a2,
27                  uintreg_t a3, uintreg_t a4, uintreg_t a5);
28 intreg_t syscall_async(env_t* e, syscall_req_t *syscall);
29 intreg_t process_generic_syscalls(env_t* e, size_t max);
30
31 /* Tracing functions */
32 void systrace_start(bool silent);
33 void systrace_stop(void);
34 int systrace_reg(bool all, struct proc *p);
35 int systrace_dereg(bool all, struct proc *p);
36 void systrace_print(bool all, struct proc *p);
37 void systrace_clear_buffer(void);
38
39 #endif /* !ROS_KERN_SYSCALL_H */