3 # error "This is ROS kernel header; user programs should not #include it"
6 #include <ros/common.h>
12 #define SYSTRACE_ON 0x01
13 #define SYSTRACE_LOUD 0x02
14 #define SYSTRACE_ALLPROC 0x04
16 #define MAX_SYSTRACES 1024
18 #define SYSCALL_STRLEN 128
20 #define MAX_ASRC_BATCH 10
22 #define SYSTR_RECORD_SZ 256
23 #define SYSTR_BUF_SZ PGSIZE
24 #define SYSTR_PRETTY_BUF_SZ (SYSTR_BUF_SZ - \
25 sizeof(struct systrace_record))
26 struct systrace_record {
27 struct systrace_record_anon {
28 uint64_t start_timestamp, end_timestamp;
43 uint8_t data[SYSTR_RECORD_SZ - sizeof(struct systrace_record_anon)];
50 unsigned long appx_nr_sysc;
51 struct kref procs; /* when procs goes to zero, q is hung up. */
52 struct kref users; /* when users goes to zero, q and struct are freed. */
55 DECLARE_BITMAP(trace_set, MAX_SYSCALL_NR);
58 extern bool systrace_loud;
61 typedef intreg_t (*syscall_t)(struct proc *, uintreg_t, uintreg_t, uintreg_t,
62 uintreg_t, uintreg_t, uintreg_t);
63 struct sys_table_entry {
67 extern const struct sys_table_entry syscall_table[];
68 extern const int max_syscall;
69 /* Syscall invocation */
70 void prep_syscalls(struct proc *p, struct syscall *sysc, unsigned int nr_calls);
71 void run_local_syscall(struct syscall *sysc);
72 intreg_t syscall(struct proc *p, uintreg_t sc_num, uintreg_t a0, uintreg_t a1,
73 uintreg_t a2, uintreg_t a3, uintreg_t a4, uintreg_t a5);
74 void set_errno(int errno);
76 void unset_errno(void);
77 void vset_errstr(const char *fmt, va_list ap);
78 void set_errstr(const char *errstr, ...);
79 char *current_errstr(void);
80 void set_error(int error, const char *fmt, ...);
81 struct errbuf *get_cur_errbuf(void);
82 void set_cur_errbuf(struct errbuf *ebuf);
83 char *get_cur_genbuf(void);
84 void __signal_syscall(struct syscall *sysc, struct proc *p);
87 bool syscall_uses_fd(struct syscall *sysc, int fd);
88 void print_sysc(struct proc *p, struct syscall *sysc);