aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/um
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2012-10-07 22:26:17 -0400
committerRichard Weinberger <richard@nod.at>2012-10-09 16:28:17 -0400
commit8813f67439524ab54978b011c51665e1854a64b5 (patch)
treed81ff2a3f9992bcb669c6dc08c93c1bf41fa97e4 /arch/x86/um
parent4301785c7c7ca712797f2f25bcd531b1d226ccb3 (diff)
um/x86: merge 32 and 64 bit variants of ptrace.h
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/x86/um')
-rw-r--r--arch/x86/um/asm/ptrace.h58
-rw-r--r--arch/x86/um/asm/ptrace_32.h28
-rw-r--r--arch/x86/um/asm/ptrace_64.h46
3 files changed, 54 insertions, 78 deletions
diff --git a/arch/x86/um/asm/ptrace.h b/arch/x86/um/asm/ptrace.h
index e72cd0df5ba3..755133258c45 100644
--- a/arch/x86/um/asm/ptrace.h
+++ b/arch/x86/um/asm/ptrace.h
@@ -1,11 +1,13 @@
1#ifndef __UM_X86_PTRACE_H 1#ifndef __UM_X86_PTRACE_H
2#define __UM_X86_PTRACE_H 2#define __UM_X86_PTRACE_H
3 3
4#ifdef CONFIG_X86_32 4#include <linux/compiler.h>
5# include "ptrace_32.h" 5#ifndef CONFIG_X86_32
6#else 6#define __FRAME_OFFSETS /* Needed to get the R* macros */
7# include "ptrace_64.h"
8#endif 7#endif
8#include <asm/ptrace-generic.h>
9
10#define user_mode(r) UPT_IS_USER(&(r)->regs)
9 11
10#define PT_REGS_AX(r) UPT_AX(&(r)->regs) 12#define PT_REGS_AX(r) UPT_AX(&(r)->regs)
11#define PT_REGS_BX(r) UPT_BX(&(r)->regs) 13#define PT_REGS_BX(r) UPT_BX(&(r)->regs)
@@ -36,4 +38,52 @@ static inline long regs_return_value(struct pt_regs *regs)
36{ 38{
37 return PT_REGS_AX(regs); 39 return PT_REGS_AX(regs);
38} 40}
41
42/*
43 * Forward declaration to avoid including sysdep/tls.h, which causes a
44 * circular include, and compilation failures.
45 */
46struct user_desc;
47
48#ifdef CONFIG_X86_32
49
50#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
51
52extern int ptrace_get_thread_area(struct task_struct *child, int idx,
53 struct user_desc __user *user_desc);
54
55extern int ptrace_set_thread_area(struct task_struct *child, int idx,
56 struct user_desc __user *user_desc);
57
58#else
59
60#define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64
61
62#define PT_REGS_R8(r) UPT_R8(&(r)->regs)
63#define PT_REGS_R9(r) UPT_R9(&(r)->regs)
64#define PT_REGS_R10(r) UPT_R10(&(r)->regs)
65#define PT_REGS_R11(r) UPT_R11(&(r)->regs)
66#define PT_REGS_R12(r) UPT_R12(&(r)->regs)
67#define PT_REGS_R13(r) UPT_R13(&(r)->regs)
68#define PT_REGS_R14(r) UPT_R14(&(r)->regs)
69#define PT_REGS_R15(r) UPT_R15(&(r)->regs)
70
71#include <asm/errno.h>
72
73static inline int ptrace_get_thread_area(struct task_struct *child, int idx,
74 struct user_desc __user *user_desc)
75{
76 return -ENOSYS;
77}
78
79static inline int ptrace_set_thread_area(struct task_struct *child, int idx,
80 struct user_desc __user *user_desc)
81{
82 return -ENOSYS;
83}
84
85extern long arch_prctl(struct task_struct *task, int code,
86 unsigned long __user *addr);
87
88#endif
39#endif /* __UM_X86_PTRACE_H */ 89#endif /* __UM_X86_PTRACE_H */
diff --git a/arch/x86/um/asm/ptrace_32.h b/arch/x86/um/asm/ptrace_32.h
deleted file mode 100644
index 2cf225351b65..000000000000
--- a/arch/x86/um/asm/ptrace_32.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
5
6#ifndef __UM_PTRACE_I386_H
7#define __UM_PTRACE_I386_H
8
9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
10
11#include "linux/compiler.h"
12#include "asm/ptrace-generic.h"
13
14#define user_mode(r) UPT_IS_USER(&(r)->regs)
15
16/*
17 * Forward declaration to avoid including sysdep/tls.h, which causes a
18 * circular include, and compilation failures.
19 */
20struct user_desc;
21
22extern int ptrace_get_thread_area(struct task_struct *child, int idx,
23 struct user_desc __user *user_desc);
24
25extern int ptrace_set_thread_area(struct task_struct *child, int idx,
26 struct user_desc __user *user_desc);
27
28#endif
diff --git a/arch/x86/um/asm/ptrace_64.h b/arch/x86/um/asm/ptrace_64.h
deleted file mode 100644
index ea7bff394320..000000000000
--- a/arch/x86/um/asm/ptrace_64.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
7#ifndef __UM_PTRACE_X86_64_H
8#define __UM_PTRACE_X86_64_H
9
10#include "linux/compiler.h"
11#include "asm/errno.h"
12
13#define __FRAME_OFFSETS /* Needed to get the R* macros */
14#include "asm/ptrace-generic.h"
15
16#define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64
17
18#define PT_REGS_R8(r) UPT_R8(&(r)->regs)
19#define PT_REGS_R9(r) UPT_R9(&(r)->regs)
20#define PT_REGS_R10(r) UPT_R10(&(r)->regs)
21#define PT_REGS_R11(r) UPT_R11(&(r)->regs)
22#define PT_REGS_R12(r) UPT_R12(&(r)->regs)
23#define PT_REGS_R13(r) UPT_R13(&(r)->regs)
24#define PT_REGS_R14(r) UPT_R14(&(r)->regs)
25#define PT_REGS_R15(r) UPT_R15(&(r)->regs)
26
27/* XXX */
28#define user_mode(r) UPT_IS_USER(&(r)->regs)
29
30struct user_desc;
31
32static inline int ptrace_get_thread_area(struct task_struct *child, int idx,
33 struct user_desc __user *user_desc)
34{
35 return -ENOSYS;
36}
37
38static inline int ptrace_set_thread_area(struct task_struct *child, int idx,
39 struct user_desc __user *user_desc)
40{
41 return -ENOSYS;
42}
43
44extern long arch_prctl(struct task_struct *task, int code,
45 unsigned long __user *addr);
46#endif