This source file includes following definitions.
- syscall_get_nr
- syscall_rollback
- syscall_get_error
- syscall_get_return_value
- syscall_set_return_value
- syscall_get_arguments
- syscall_set_arguments
- syscall_get_arch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef __ASM_OPENRISC_SYSCALL_H__
16 #define __ASM_OPENRISC_SYSCALL_H__
17
18 #include <uapi/linux/audit.h>
19 #include <linux/err.h>
20 #include <linux/sched.h>
21
22 static inline int
23 syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
24 {
25 return regs->orig_gpr11;
26 }
27
28 static inline void
29 syscall_rollback(struct task_struct *task, struct pt_regs *regs)
30 {
31 regs->gpr[11] = regs->orig_gpr11;
32 }
33
34 static inline long
35 syscall_get_error(struct task_struct *task, struct pt_regs *regs)
36 {
37 return IS_ERR_VALUE(regs->gpr[11]) ? regs->gpr[11] : 0;
38 }
39
40 static inline long
41 syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
42 {
43 return regs->gpr[11];
44 }
45
46 static inline void
47 syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
48 int error, long val)
49 {
50 regs->gpr[11] = (long) error ?: val;
51 }
52
53 static inline void
54 syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
55 unsigned long *args)
56 {
57 memcpy(args, ®s->gpr[3], 6 * sizeof(args[0]));
58 }
59
60 static inline void
61 syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
62 const unsigned long *args)
63 {
64 memcpy(®s->gpr[3], args, 6 * sizeof(args[0]));
65 }
66
67 static inline int syscall_get_arch(struct task_struct *task)
68 {
69 return AUDIT_ARCH_OPENRISC;
70 }
71 #endif