3 # error "This is ROS kernel header; user programs should not #include it"
6 #include <ros/common.h>
7 #include <ros/syscall.h>
13 #define SYSTRACE_ON 0x01
14 #define SYSTRACE_LOUD 0x02
15 #define SYSTRACE_ALLPROC 0x04
17 #define MAX_SYSTRACES 1024
19 #define SYSCALL_STRLEN 128
21 #define MAX_ASRC_BATCH 10
23 #define SYSTR_RECORD_SZ 256
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)];
51 unsigned long appx_nr_sysc;
52 struct kref procs; /* when procs goes to zero, q is hung up. */
53 struct kref users; /* when users goes to zero, q and struct are freed. */
56 DECLARE_BITMAP(trace_set, MAX_SYSCALL_NR);
59 extern bool systrace_loud;
62 typedef intreg_t (*syscall_t)(struct proc *, uintreg_t, uintreg_t, uintreg_t,
63 uintreg_t, uintreg_t, uintreg_t);
64 struct sys_table_entry {
68 extern const struct sys_table_entry syscall_table[];
69 extern const int max_syscall;
70 /* Syscall invocation */
71 void prep_syscalls(struct proc *p, struct syscall *sysc, unsigned int nr_calls);
72 void run_local_syscall(struct syscall *sysc);
73 intreg_t syscall(struct proc *p, uintreg_t sc_num, uintreg_t a0, uintreg_t a1,
74 uintreg_t a2, uintreg_t a3, uintreg_t a4, uintreg_t a5);
75 void set_errno(int errno);
77 void unset_errno(void);
78 void vset_errstr(const char *fmt, va_list ap);
79 void set_errstr(const char *errstr, ...);
80 char *current_errstr(void);
81 void set_error(int error, const char *fmt, ...);
82 struct errbuf *get_cur_errbuf(void);
83 void set_cur_errbuf(struct errbuf *ebuf);
84 char *get_cur_genbuf(void);
85 void __signal_syscall(struct syscall *sysc, struct proc *p);
88 bool syscall_uses_fd(struct syscall *sysc, int fd);
89 void print_sysc(struct proc *p, struct syscall *sysc);
90 void kth_panic_sysc(struct kthread *kth);