2 * Copyright Altera Corporation (C) <2014>. All rights reserved
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License along with
14 * this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef __ASM_NIOS2_SYSCALL_H__
18 #define __ASM_NIOS2_SYSCALL_H__
20 #include <linux/err.h>
21 #include <linux/sched.h>
23 static inline int syscall_get_nr(struct task_struct
*task
, struct pt_regs
*regs
)
28 static inline void syscall_rollback(struct task_struct
*task
,
31 regs
->r2
= regs
->orig_r2
;
32 regs
->r7
= regs
->orig_r7
;
35 static inline long syscall_get_error(struct task_struct
*task
,
38 return regs
->r7
? regs
->r2
: 0;
41 static inline long syscall_get_return_value(struct task_struct
*task
,
47 static inline void syscall_set_return_value(struct task_struct
*task
,
48 struct pt_regs
*regs
, int error
, long val
)
51 /* error < 0, but nios2 uses > 0 return value */
60 static inline void syscall_get_arguments(struct task_struct
*task
,
61 struct pt_regs
*regs
, unsigned int i
, unsigned int n
,
99 static inline void syscall_set_arguments(struct task_struct
*task
,
100 struct pt_regs
*regs
, unsigned int i
, unsigned int n
,
101 const unsigned long *args
)