This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-x86_64 / tracehook.h
1 /*
2  * Tracing hooks, x86-64 CPU support
3  */
4
5 #ifndef _ASM_TRACEHOOK_H
6 #define _ASM_TRACEHOOK_H        1
7
8 #include <linux/sched.h>
9 #include <asm/ptrace.h>
10 #include <asm/proto.h>
11
12 /*
13  * See linux/tracehook.h for the descriptions of what these need to do.
14  */
15
16 #define ARCH_HAS_SINGLE_STEP    (1)
17
18 /* These two are defined in arch/x86_64/kernel/ptrace.c.  */
19 void tracehook_enable_single_step(struct task_struct *tsk);
20 void tracehook_disable_single_step(struct task_struct *tsk);
21
22 static inline int tracehook_single_step_enabled(struct task_struct *tsk)
23 {
24         return test_tsk_thread_flag(tsk, TIF_SINGLESTEP);
25 }
26
27 static inline void tracehook_enable_syscall_trace(struct task_struct *tsk)
28 {
29         set_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
30 }
31
32 static inline void tracehook_disable_syscall_trace(struct task_struct *tsk)
33 {
34         clear_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
35 }
36
37 static inline void tracehook_abort_syscall(struct pt_regs *regs)
38 {
39         regs->orig_rax = -1L;
40 }
41
42 extern const struct utrace_regset_view utrace_x86_64_native, utrace_ia32_view;
43 static inline const struct utrace_regset_view *
44 utrace_native_view(struct task_struct *tsk)
45 {
46 #ifdef CONFIG_IA32_EMULATION
47         if (test_tsk_thread_flag(tsk, TIF_IA32))
48                 return &utrace_ia32_view;
49 #endif
50         return &utrace_x86_64_native;
51 }
52
53
54 #endif