1 #ifndef __ASM_H8300_SYSCALLS_32_H
2 #define __ASM_H8300_SYSCALLS_32_H
3
4 #ifdef __KERNEL__
5
6 #include <linux/compiler.h>
7 #include <linux/linkage.h>
8 #include <linux/types.h>
9 #include <linux/ptrace.h>
10
11 static inline int
syscall_get_nr(struct task_struct * task,struct pt_regs * regs)12 syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
13 {
14 return regs->orig_er0;
15 }
16
17 static inline void
syscall_get_arguments(struct task_struct * task,struct pt_regs * regs,unsigned int i,unsigned int n,unsigned long * args)18 syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
19 unsigned int i, unsigned int n, unsigned long *args)
20 {
21 BUG_ON(i + n > 6);
22
23 while (n > 0) {
24 switch (i) {
25 case 0:
26 *args++ = regs->er1;
27 break;
28 case 1:
29 *args++ = regs->er2;
30 break;
31 case 2:
32 *args++ = regs->er3;
33 break;
34 case 3:
35 *args++ = regs->er4;
36 break;
37 case 4:
38 *args++ = regs->er5;
39 break;
40 case 5:
41 *args++ = regs->er6;
42 break;
43 }
44 i++;
45 n--;
46 }
47 }
48
49
50
51 /* Misc syscall related bits */
52 asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
53 asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
54
55 #endif /* __KERNEL__ */
56 #endif /* __ASM_H8300_SYSCALLS_32_H */
57