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>
11 extern void *sys_call_table
[];
14 syscall_get_nr(struct task_struct
*task
, struct pt_regs
*regs
)
16 return regs_syscallid(regs
);
20 syscall_set_nr(struct task_struct
*task
, struct pt_regs
*regs
,
23 regs_syscallid(regs
) = sysno
;
27 syscall_rollback(struct task_struct
*task
, struct pt_regs
*regs
)
29 regs
->a0
= regs
->orig_a0
;
33 syscall_get_error(struct task_struct
*task
, struct pt_regs
*regs
)
35 unsigned long error
= regs
->a0
;
37 return IS_ERR_VALUE(error
) ? error
: 0;
41 syscall_get_return_value(struct task_struct
*task
, struct pt_regs
*regs
)
47 syscall_set_return_value(struct task_struct
*task
, struct pt_regs
*regs
,
50 regs
->a0
= (long) error
?: val
;
54 syscall_get_arguments(struct task_struct
*task
, struct pt_regs
*regs
,
57 args
[0] = regs
->orig_a0
;
59 memcpy(args
, ®s
->a1
, 5 * sizeof(args
[0]));
63 syscall_set_arguments(struct task_struct
*task
, struct pt_regs
*regs
,
64 const unsigned long *args
)
66 regs
->orig_a0
= args
[0];
68 memcpy(®s
->a1
, args
, 5 * sizeof(regs
->a1
));
72 syscall_get_arch(struct task_struct
*task
)
74 return AUDIT_ARCH_CSKY
;
77 #endif /* __ASM_SYSCALL_H */