1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_MICROBLAZE_SYSCALL_H
3 #define __ASM_MICROBLAZE_SYSCALL_H
5 #include <uapi/linux/audit.h>
6 #include <linux/kernel.h>
7 #include <linux/sched.h>
8 #include <asm/ptrace.h>
10 /* The system call number is given by the user in R12 */
11 static inline long syscall_get_nr(struct task_struct
*task
,
17 static inline void syscall_rollback(struct task_struct
*task
,
23 static inline long syscall_get_error(struct task_struct
*task
,
26 return IS_ERR_VALUE(regs
->r3
) ? regs
->r3
: 0;
29 static inline long syscall_get_return_value(struct task_struct
*task
,
35 static inline void syscall_set_return_value(struct task_struct
*task
,
45 static inline microblaze_reg_t
microblaze_get_syscall_arg(struct pt_regs
*regs
,
49 case 5: return regs
->r10
;
50 case 4: return regs
->r9
;
51 case 3: return regs
->r8
;
52 case 2: return regs
->r7
;
53 case 1: return regs
->r6
;
54 case 0: return regs
->r5
;
61 static inline void microblaze_set_syscall_arg(struct pt_regs
*regs
,
83 static inline void syscall_get_arguments(struct task_struct
*task
,
91 *args
++ = microblaze_get_syscall_arg(regs
, i
++);
94 static inline void syscall_set_arguments(struct task_struct
*task
,
96 const unsigned long *args
)
102 microblaze_set_syscall_arg(regs
, i
++, *args
++);
105 asmlinkage
unsigned long do_syscall_trace_enter(struct pt_regs
*regs
);
106 asmlinkage
void do_syscall_trace_leave(struct pt_regs
*regs
);
108 static inline int syscall_get_arch(struct task_struct
*task
)
110 return AUDIT_ARCH_MICROBLAZE
;
112 #endif /* __ASM_MICROBLAZE_SYSCALL_H */