1 #ifndef ROS_KERN_SYSCALL_H
2 #define ROS_KERN_SYSCALL_H
4 # error "This is ROS kernel header; user programs should not #include it"
7 #include <ros/common.h>
10 #define SYSTRACE_ON 0x01
11 #define SYSTRACE_LOUD 0x02
12 #define SYSTRACE_ALLPROC 0x04
14 #define MAX_NUM_TRACED 10
15 #define MAX_SYSTRACES 1024
17 #define SYSCALL_STRLEN 128
19 #define MAX_ASRC_BATCH 10
21 /* Consider cache aligning this */
22 struct systrace_record {
37 typedef intreg_t (*syscall_t)(struct proc *, uintreg_t, uintreg_t, uintreg_t,
38 uintreg_t, uintreg_t, uintreg_t);
39 struct sys_table_entry {
43 extern const struct sys_table_entry syscall_table[];
44 extern const int max_syscall;
45 /* Syscall invocation */
46 void prep_syscalls(struct proc *p, struct syscall *sysc, unsigned int nr_calls);
47 void run_local_syscall(struct syscall *sysc);
48 intreg_t syscall(struct proc *p, uintreg_t sc_num, uintreg_t a0, uintreg_t a1,
49 uintreg_t a2, uintreg_t a3, uintreg_t a4, uintreg_t a5);
50 void set_errno(int errno);
52 void unset_errno(void);
53 void set_errstr(char *errstr, ...);
54 char *current_errstr(void);
55 struct errbuf *get_cur_errbuf(void);
56 void set_cur_errbuf(struct errbuf *ebuf);
57 char *get_cur_genbuf(void);
58 void __signal_syscall(struct syscall *sysc, struct proc *p);
60 /* Tracing functions */
61 void systrace_start(bool silent);
62 void systrace_stop(void);
63 int systrace_reg(bool all, struct proc *p);
64 int systrace_dereg(bool all, struct proc *p);
65 void systrace_print(bool all, struct proc *p);
66 void systrace_clear_buffer(void);
69 bool syscall_uses_fd(struct syscall *sysc, int fd);
71 #endif /* !ROS_KERN_SYSCALL_H */