2 * Access to user system call parameters and results
4 * Copyright (C) 2008 Intel Corp. Shaohua Li <shaohua.li@intel.com>
6 * This copyrighted material is made available to anyone wishing to use,
7 * modify, copy, or redistribute it subject to the terms and conditions
8 * of the GNU General Public License v.2.
10 * See asm-generic/syscall.h for descriptions of what we must do here.
13 #ifndef _ASM_SYSCALL_H
14 #define _ASM_SYSCALL_H 1
16 #include <linux/sched.h>
17 #include <linux/err.h>
19 static inline long syscall_get_nr(struct task_struct
*task
,
22 if ((long)regs
->cr_ifs
< 0) /* Not a syscall */
25 #ifdef CONFIG_IA32_SUPPORT
26 if (IS_IA32_PROCESS(regs
))
33 static inline void syscall_rollback(struct task_struct
*task
,
36 #ifdef CONFIG_IA32_SUPPORT
37 if (IS_IA32_PROCESS(regs
))
44 static inline long syscall_get_error(struct task_struct
*task
,
47 #ifdef CONFIG_IA32_SUPPORT
48 if (IS_IA32_PROCESS(regs
))
52 return regs
->r10
== -1 ? regs
->r8
:0;
55 static inline long syscall_get_return_value(struct task_struct
*task
,
61 static inline void syscall_set_return_value(struct task_struct
*task
,
65 #ifdef CONFIG_IA32_SUPPORT
66 if (IS_IA32_PROCESS(regs
)) {
67 regs
->r8
= (long) error
? error
: val
;
73 /* error < 0, but ia64 uses > 0 return value */
82 extern void ia64_syscall_get_set_arguments(struct task_struct
*task
,
83 struct pt_regs
*regs
, unsigned int i
, unsigned int n
,
84 unsigned long *args
, int rw
);
85 static inline void syscall_get_arguments(struct task_struct
*task
,
87 unsigned int i
, unsigned int n
,
92 #ifdef CONFIG_IA32_SUPPORT
93 if (IS_IA32_PROCESS(regs
)) {
123 ia64_syscall_get_set_arguments(task
, regs
, i
, n
, args
, 0);
126 static inline void syscall_set_arguments(struct task_struct
*task
,
127 struct pt_regs
*regs
,
128 unsigned int i
, unsigned int n
,
133 #ifdef CONFIG_IA32_SUPPORT
134 if (IS_IA32_PROCESS(regs
)) {
161 ia64_syscall_get_set_arguments(task
, regs
, i
, n
, args
, 1);
163 #endif /* _ASM_SYSCALL_H */