aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/include
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2008-09-18 03:49:14 -0400
committerTony Luck <tony.luck@intel.com>2008-10-06 13:41:37 -0400
commitcfb361f13c8136de78c406745abc4e4456e6d480 (patch)
tree3edb03ec94ee1f5d45f1e7299c461d397bdcbd5e /arch/ia64/include
parentfec6ed1d1f9b78a6acb4a3eb2c46c812ac2e96f0 (diff)
[IA64] utrace syscall.h support for ia64
Add asm/syscall.h for IA64. Utrace requires this. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/include')
-rw-r--r--arch/ia64/include/asm/ptrace.h6
-rw-r--r--arch/ia64/include/asm/syscall.h92
2 files changed, 98 insertions, 0 deletions
diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include/asm/ptrace.h
index 15f8dcfe6eee..14055c636adf 100644
--- a/arch/ia64/include/asm/ptrace.h
+++ b/arch/ia64/include/asm/ptrace.h
@@ -240,6 +240,12 @@ struct switch_stack {
240 */ 240 */
241# define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri) 241# define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri)
242 242
243static inline unsigned long user_stack_pointer(struct pt_regs *regs)
244{
245 /* FIXME: should this be bspstore + nr_dirty regs? */
246 return regs->ar_bspstore;
247}
248
243#define regs_return_value(regs) ((regs)->r8) 249#define regs_return_value(regs) ((regs)->r8)
244 250
245/* Conserve space in histogram by encoding slot bits in address 251/* Conserve space in histogram by encoding slot bits in address
diff --git a/arch/ia64/include/asm/syscall.h b/arch/ia64/include/asm/syscall.h
new file mode 100644
index 000000000000..3fd4fa6c48dd
--- /dev/null
+++ b/arch/ia64/include/asm/syscall.h
@@ -0,0 +1,92 @@
1/*
2 * Access to user system call parameters and results
3 *
4 * Copyright (C) 2008 Intel Corp. Shaohua Li <shaohua.li@intel.com>
5 *
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.
9 *
10 * See asm-generic/syscall.h for descriptions of what we must do here.
11 */
12
13#ifndef _ASM_SYSCALL_H
14#define _ASM_SYSCALL_H 1
15
16#include <linux/sched.h>
17#include <linux/err.h>
18
19static inline long syscall_get_nr(struct task_struct *task,
20 struct pt_regs *regs)
21{
22 BUG_ON(IS_IA32_PROCESS(regs));
23
24 if ((long)regs->cr_ifs < 0) /* Not a syscall */
25 return -1;
26 return regs->r15;
27}
28
29static inline void syscall_rollback(struct task_struct *task,
30 struct pt_regs *regs)
31{
32 BUG_ON(IS_IA32_PROCESS(regs));
33 /* do nothing */
34}
35
36static inline long syscall_get_error(struct task_struct *task,
37 struct pt_regs *regs)
38{
39 BUG_ON(IS_IA32_PROCESS(regs));
40
41 return regs->r10 == -1 ? regs->r8:0;
42}
43
44static inline long syscall_get_return_value(struct task_struct *task,
45 struct pt_regs *regs)
46{
47 BUG_ON(IS_IA32_PROCESS(regs));
48
49 return regs->r8;
50}
51
52static inline void syscall_set_return_value(struct task_struct *task,
53 struct pt_regs *regs,
54 int error, long val)
55{
56 BUG_ON(IS_IA32_PROCESS(regs));
57
58 if (error) {
59 /* error < 0, but ia64 uses > 0 return value */
60 regs->r8 = -error;
61 regs->r10 = -1;
62 } else {
63 regs->r8 = val;
64 regs->r10 = 0;
65 }
66}
67
68extern void ia64_syscall_get_set_arguments(struct task_struct *task,
69 struct pt_regs *regs, unsigned int i, unsigned int n,
70 unsigned long *args, int rw);
71static inline void syscall_get_arguments(struct task_struct *task,
72 struct pt_regs *regs,
73 unsigned int i, unsigned int n,
74 unsigned long *args)
75{
76 BUG_ON(IS_IA32_PROCESS(regs));
77 BUG_ON(i + n > 6);
78
79 ia64_syscall_get_set_arguments(task, regs, i, n, args, 0);
80}
81
82static inline void syscall_set_arguments(struct task_struct *task,
83 struct pt_regs *regs,
84 unsigned int i, unsigned int n,
85 unsigned long *args)
86{
87 BUG_ON(IS_IA32_PROCESS(regs));
88 BUG_ON(i + n > 6);
89
90 ia64_syscall_get_set_arguments(task, regs, i, n, args, 1);
91}
92#endif /* _ASM_SYSCALL_H */