diff options
Diffstat (limited to 'include/asm-x86/ptrace.h')
-rw-r--r-- | include/asm-x86/ptrace.h | 58 |
1 files changed, 48 insertions, 10 deletions
diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h index 8a71db803da6..a2025525a15a 100644 --- a/include/asm-x86/ptrace.h +++ b/include/asm-x86/ptrace.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _ASM_X86_PTRACE_H | 1 | #ifndef ASM_X86__PTRACE_H |
2 | #define _ASM_X86_PTRACE_H | 2 | #define ASM_X86__PTRACE_H |
3 | 3 | ||
4 | #include <linux/compiler.h> /* For __user */ | 4 | #include <linux/compiler.h> /* For __user */ |
5 | #include <asm/ptrace-abi.h> | 5 | #include <asm/ptrace-abi.h> |
@@ -127,26 +127,59 @@ struct pt_regs { | |||
127 | #endif /* __KERNEL__ */ | 127 | #endif /* __KERNEL__ */ |
128 | #endif /* !__i386__ */ | 128 | #endif /* !__i386__ */ |
129 | 129 | ||
130 | |||
131 | #ifdef CONFIG_X86_PTRACE_BTS | ||
132 | /* a branch trace record entry | ||
133 | * | ||
134 | * In order to unify the interface between various processor versions, | ||
135 | * we use the below data structure for all processors. | ||
136 | */ | ||
137 | enum bts_qualifier { | ||
138 | BTS_INVALID = 0, | ||
139 | BTS_BRANCH, | ||
140 | BTS_TASK_ARRIVES, | ||
141 | BTS_TASK_DEPARTS | ||
142 | }; | ||
143 | |||
144 | struct bts_struct { | ||
145 | __u64 qualifier; | ||
146 | union { | ||
147 | /* BTS_BRANCH */ | ||
148 | struct { | ||
149 | __u64 from_ip; | ||
150 | __u64 to_ip; | ||
151 | } lbr; | ||
152 | /* BTS_TASK_ARRIVES or | ||
153 | BTS_TASK_DEPARTS */ | ||
154 | __u64 jiffies; | ||
155 | } variant; | ||
156 | }; | ||
157 | #endif /* CONFIG_X86_PTRACE_BTS */ | ||
158 | |||
130 | #ifdef __KERNEL__ | 159 | #ifdef __KERNEL__ |
131 | 160 | ||
132 | /* the DS BTS struct is used for ptrace as well */ | 161 | #include <linux/init.h> |
133 | #include <asm/ds.h> | ||
134 | 162 | ||
163 | struct cpuinfo_x86; | ||
135 | struct task_struct; | 164 | struct task_struct; |
136 | 165 | ||
166 | #ifdef CONFIG_X86_PTRACE_BTS | ||
167 | extern void __cpuinit ptrace_bts_init_intel(struct cpuinfo_x86 *); | ||
137 | extern void ptrace_bts_take_timestamp(struct task_struct *, enum bts_qualifier); | 168 | extern void ptrace_bts_take_timestamp(struct task_struct *, enum bts_qualifier); |
169 | #else | ||
170 | #define ptrace_bts_init_intel(config) do {} while (0) | ||
171 | #endif /* CONFIG_X86_PTRACE_BTS */ | ||
138 | 172 | ||
139 | extern unsigned long profile_pc(struct pt_regs *regs); | 173 | extern unsigned long profile_pc(struct pt_regs *regs); |
140 | 174 | ||
141 | extern unsigned long | 175 | extern unsigned long |
142 | convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); | 176 | convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs); |
143 | |||
144 | #ifdef CONFIG_X86_32 | ||
145 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | 177 | extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, |
146 | int error_code); | 178 | int error_code, int si_code); |
147 | #else | ||
148 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | 179 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); |
149 | #endif | 180 | |
181 | extern long syscall_trace_enter(struct pt_regs *); | ||
182 | extern void syscall_trace_leave(struct pt_regs *); | ||
150 | 183 | ||
151 | static inline unsigned long regs_return_value(struct pt_regs *regs) | 184 | static inline unsigned long regs_return_value(struct pt_regs *regs) |
152 | { | 185 | { |
@@ -213,6 +246,11 @@ static inline unsigned long frame_pointer(struct pt_regs *regs) | |||
213 | return regs->bp; | 246 | return regs->bp; |
214 | } | 247 | } |
215 | 248 | ||
249 | static inline unsigned long user_stack_pointer(struct pt_regs *regs) | ||
250 | { | ||
251 | return regs->sp; | ||
252 | } | ||
253 | |||
216 | /* | 254 | /* |
217 | * These are defined as per linux/ptrace.h, which see. | 255 | * These are defined as per linux/ptrace.h, which see. |
218 | */ | 256 | */ |
@@ -239,4 +277,4 @@ extern int do_set_thread_area(struct task_struct *p, int idx, | |||
239 | 277 | ||
240 | #endif /* !__ASSEMBLY__ */ | 278 | #endif /* !__ASSEMBLY__ */ |
241 | 279 | ||
242 | #endif | 280 | #endif /* ASM_X86__PTRACE_H */ |