fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / asm-x86_64 / tracehook.h
1 /*
2  * Tracing hooks, x86-64 CPU support
3  *
4  * Copyright (C) 2006, 2007 Red Hat, Inc.  All rights reserved.
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  * Red Hat Author: Roland McGrath.
11  */
12
13 #ifndef _ASM_TRACEHOOK_H
14 #define _ASM_TRACEHOOK_H        1
15
16 #include <linux/sched.h>
17 #include <asm/ptrace.h>
18 #include <asm/proto.h>
19
20 /*
21  * See linux/tracehook.h for the descriptions of what these need to do.
22  */
23
24 #define ARCH_HAS_SINGLE_STEP    (1)
25
26 /* These two are defined in arch/x86_64/kernel/ptrace.c.  */
27 void tracehook_enable_single_step(struct task_struct *tsk);
28 void tracehook_disable_single_step(struct task_struct *tsk);
29
30 static inline int tracehook_single_step_enabled(struct task_struct *tsk)
31 {
32         return test_tsk_thread_flag(tsk, TIF_SINGLESTEP);
33 }
34
35 static inline void tracehook_enable_syscall_trace(struct task_struct *tsk)
36 {
37         set_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
38 }
39
40 static inline void tracehook_disable_syscall_trace(struct task_struct *tsk)
41 {
42         clear_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
43 }
44
45 static inline void tracehook_abort_syscall(struct pt_regs *regs)
46 {
47         regs->orig_rax = -1L;
48 }
49
50 extern const struct utrace_regset_view utrace_x86_64_native, utrace_ia32_view;
51 static inline const struct utrace_regset_view *
52 utrace_native_view(struct task_struct *tsk)
53 {
54 #ifdef CONFIG_IA32_EMULATION
55         if (test_tsk_thread_flag(tsk, TIF_IA32))
56                 return &utrace_ia32_view;
57 #endif
58         return &utrace_x86_64_native;
59 }
60
61 #endif