1 #ifndef __ASM_MICROBLAZE_SYSCALL_H
2 #define __ASM_MICROBLAZE_SYSCALL_H
4 #include <uapi/linux/audit.h>
5 #include <linux/kernel.h>
6 #include <linux/sched.h>
7 #include <asm/ptrace.h>
9 /* The system call number is given by the user in R12 */
10 static inline long syscall_get_nr(struct task_struct
*task
,
16 static inline void syscall_rollback(struct task_struct
*task
,
22 static inline long syscall_get_error(struct task_struct
*task
,
25 return IS_ERR_VALUE(regs
->r3
) ? regs
->r3
: 0;
28 static inline long syscall_get_return_value(struct task_struct
*task
,
34 static inline void syscall_set_return_value(struct task_struct
*task
,
44 static inline microblaze_reg_t
microblaze_get_syscall_arg(struct pt_regs
*regs
,
48 case 5: return regs
->r10
;
49 case 4: return regs
->r9
;
50 case 3: return regs
->r8
;
51 case 2: return regs
->r7
;
52 case 1: return regs
->r6
;
53 case 0: return regs
->r5
;
60 static inline void microblaze_set_syscall_arg(struct pt_regs
*regs
,
82 static inline void syscall_get_arguments(struct task_struct
*task
,
84 unsigned int i
, unsigned int n
,
88 *args
++ = microblaze_get_syscall_arg(regs
, i
++);
91 static inline void syscall_set_arguments(struct task_struct
*task
,
93 unsigned int i
, unsigned int n
,
94 const unsigned long *args
)
97 microblaze_set_syscall_arg(regs
, i
++, *args
++);
100 asmlinkage
unsigned long do_syscall_trace_enter(struct pt_regs
*regs
);
101 asmlinkage
void do_syscall_trace_leave(struct pt_regs
*regs
);
103 static inline int syscall_get_arch(void)
105 return AUDIT_ARCH_MICROBLAZE
;
107 #endif /* __ASM_MICROBLAZE_SYSCALL_H */