1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright Altera Corporation (C) <2014>. All rights reserved
6 #ifndef __ASM_NIOS2_SYSCALL_H__
7 #define __ASM_NIOS2_SYSCALL_H__
9 #include <uapi/linux/audit.h>
10 #include <linux/err.h>
11 #include <linux/sched.h>
13 static inline int syscall_get_nr(struct task_struct
*task
, struct pt_regs
*regs
)
18 static inline void syscall_rollback(struct task_struct
*task
,
21 regs
->r2
= regs
->orig_r2
;
22 regs
->r7
= regs
->orig_r7
;
25 static inline long syscall_get_error(struct task_struct
*task
,
28 return regs
->r7
? regs
->r2
: 0;
31 static inline long syscall_get_return_value(struct task_struct
*task
,
37 static inline void syscall_set_return_value(struct task_struct
*task
,
38 struct pt_regs
*regs
, int error
, long val
)
41 /* error < 0, but nios2 uses > 0 return value */
50 static inline void syscall_get_arguments(struct task_struct
*task
,
51 struct pt_regs
*regs
, unsigned long *args
)
61 static inline void syscall_set_arguments(struct task_struct
*task
,
62 struct pt_regs
*regs
, const unsigned long *args
)
72 static inline int syscall_get_arch(struct task_struct
*task
)
74 return AUDIT_ARCH_NIOS2
;