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 #ifndef __ASM_SH_SYSCALL_64_H
3 #define __ASM_SH_SYSCALL_64_H
4
5 #include <uapi/linux/audit.h>
6 #include <linux/kernel.h>
7 #include <linux/sched.h>
8 #include <asm/ptrace.h>
9
10
11 static inline long syscall_get_nr(struct task_struct *task,
12 struct pt_regs *regs)
13 {
14 return (regs->syscall_nr >= 0) ? regs->regs[9] : -1L;
15 }
16
17 static inline void syscall_rollback(struct task_struct *task,
18 struct pt_regs *regs)
19 {
20
21
22
23
24 }
25
26 static inline long syscall_get_error(struct task_struct *task,
27 struct pt_regs *regs)
28 {
29 return IS_ERR_VALUE(regs->regs[9]) ? regs->regs[9] : 0;
30 }
31
32 static inline long syscall_get_return_value(struct task_struct *task,
33 struct pt_regs *regs)
34 {
35 return regs->regs[9];
36 }
37
38 static inline void syscall_set_return_value(struct task_struct *task,
39 struct pt_regs *regs,
40 int error, long val)
41 {
42 if (error)
43 regs->regs[9] = -error;
44 else
45 regs->regs[9] = val;
46 }
47
48 static inline void syscall_get_arguments(struct task_struct *task,
49 struct pt_regs *regs,
50 unsigned long *args)
51 {
52 memcpy(args, ®s->regs[2], 6 * sizeof(args[0]));
53 }
54
55 static inline void syscall_set_arguments(struct task_struct *task,
56 struct pt_regs *regs,
57 const unsigned long *args)
58 {
59 memcpy(®s->regs[2], args, 6 * sizeof(args[0]));
60 }
61
62 static inline int syscall_get_arch(struct task_struct *task)
63 {
64 int arch = AUDIT_ARCH_SH;
65
66 #ifdef CONFIG_64BIT
67 arch |= __AUDIT_ARCH_64BIT;
68 #endif
69 #ifdef CONFIG_CPU_LITTLE_ENDIAN
70 arch |= __AUDIT_ARCH_LE;
71 #endif
72
73 return arch;
74 }
75 #endif