1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Access to user system call parameters and results
5 * Copyright (C) 2008 Intel Corp. Shaohua Li <shaohua.li@intel.com>
7 * See asm-generic/syscall.h for descriptions of what we must do here.
10 #ifndef _ASM_SYSCALL_H
11 #define _ASM_SYSCALL_H 1
13 #include <uapi/linux/audit.h>
14 #include <linux/sched.h>
15 #include <linux/err.h>
17 static inline long syscall_get_nr(struct task_struct *task,
20 if ((long)regs->cr_ifs < 0) /* Not a syscall */
26 static inline void syscall_rollback(struct task_struct *task,
32 static inline long syscall_get_error(struct task_struct *task,
35 return regs->r10 == -1 ? regs->r8:0;
38 static inline long syscall_get_return_value(struct task_struct *task,
44 static inline void syscall_set_return_value(struct task_struct *task,
49 /* error < 0, but ia64 uses > 0 return value */
58 extern void ia64_syscall_get_set_arguments(struct task_struct *task,
59 struct pt_regs *regs, unsigned long *args, int rw);
60 static inline void syscall_get_arguments(struct task_struct *task,
64 ia64_syscall_get_set_arguments(task, regs, args, 0);
67 static inline void syscall_set_arguments(struct task_struct *task,
71 ia64_syscall_get_set_arguments(task, regs, args, 1);
74 static inline int syscall_get_arch(struct task_struct *task)
76 return AUDIT_ARCH_IA64;
78 #endif /* _ASM_SYSCALL_H */