drm/ast: Only warn about unsupported TX chips on Gen4 and later
[drm/drm-misc.git] / arch / csky / include / asm / syscall.h
blob0de5734950bf91f574fced167bba4629741351da
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __ASM_SYSCALL_H
4 #define __ASM_SYSCALL_H
6 #include <linux/sched.h>
7 #include <linux/err.h>
8 #include <abi/regdef.h>
9 #include <uapi/linux/audit.h>
11 extern void *sys_call_table[];
13 static inline int
14 syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
16 return regs_syscallid(regs);
19 static inline void
20 syscall_set_nr(struct task_struct *task, struct pt_regs *regs,
21 int sysno)
23 regs_syscallid(regs) = sysno;
26 static inline void
27 syscall_rollback(struct task_struct *task, struct pt_regs *regs)
29 regs->a0 = regs->orig_a0;
32 static inline long
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;
40 static inline long
41 syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
43 return regs->a0;
46 static inline void
47 syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
48 int error, long val)
50 regs->a0 = (long) error ?: val;
53 static inline void
54 syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
55 unsigned long *args)
57 args[0] = regs->orig_a0;
58 args++;
59 memcpy(args, &regs->a1, 5 * sizeof(args[0]));
62 static inline int
63 syscall_get_arch(struct task_struct *task)
65 return AUDIT_ARCH_CSKY;
68 #endif /* __ASM_SYSCALL_H */