aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/um/asm/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/um/asm/ptrace.h')
-rw-r--r--arch/x86/um/asm/ptrace.h58
1 files changed, 54 insertions, 4 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 */