1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __ASM_SYSCALL_H
4 #define __ASM_SYSCALL_H
6 #include <linux/sched.h>
8 #include <abi/regdef.h>
9 #include <uapi/linux/audit.h>
12 syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
14 return regs_syscallid(regs);
18 syscall_rollback(struct task_struct *task, struct pt_regs *regs)
20 regs->a0 = regs->orig_a0;
24 syscall_get_error(struct task_struct *task, struct pt_regs *regs)
26 unsigned long error = regs->a0;
28 return IS_ERR_VALUE(error) ? error : 0;
32 syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
38 syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
41 regs->a0 = (long) error ?: val;
45 syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
46 unsigned int i, unsigned int n, unsigned long *args)
50 args[0] = regs->orig_a0;
56 memcpy(args, ®s->a1 + i, n * sizeof(args[0]));
60 syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
61 unsigned int i, unsigned int n, const unsigned long *args)
65 regs->orig_a0 = args[0];
71 memcpy(®s->a1 + i, args, n * sizeof(regs->a1));
75 syscall_get_arch(void)
77 return AUDIT_ARCH_CSKY;
80 #endif /* __ASM_SYSCALL_H */