This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-ia64 / tracehook.h
1 /*
2  * Copyright (C)2006 Intel Co
3  *      Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
4  *      and Bibo Mao <bibo.mao@intel.com> adapted from i386.
5  *
6  *      Tracing hooks, ia64 CPU support
7  */
8
9 #ifndef _ASM_TRACEHOOK_H
10 #define _ASM_TRACEHOOK_H        1
11
12 #include <linux/sched.h>
13 #include <asm/ptrace.h>
14
15 /*
16  * See linux/tracehook.h for the descriptions of what these need to do.
17  */
18
19 #define ARCH_HAS_SINGLE_STEP    (1)
20 #define ARCH_HAS_BLOCK_STEP     (1)
21
22 static inline void tracehook_enable_single_step(struct task_struct *tsk)
23 {
24         struct pt_regs *pt = task_pt_regs(tsk);
25         ia64_psr(pt)->ss = 1;
26 }
27
28 static inline void tracehook_disable_single_step(struct task_struct *tsk)
29 {
30         struct pt_regs *pt = task_pt_regs(tsk);
31         ia64_psr(pt)->ss = 0;
32 }
33
34 static inline void tracehook_enable_block_step(struct task_struct *tsk)
35 {
36         struct pt_regs *pt = task_pt_regs(tsk);
37         ia64_psr(pt)->tb = 1;
38 }
39
40 static inline void tracehook_disable_block_step(struct task_struct *tsk)
41 {
42         struct pt_regs *pt = task_pt_regs(tsk);
43         ia64_psr(pt)->tb = 0;
44 }
45
46 static inline void tracehook_enable_syscall_trace(struct task_struct *tsk)
47 {
48         set_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
49 }
50
51 static inline void tracehook_disable_syscall_trace(struct task_struct *tsk)
52 {
53         clear_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
54 }
55
56 static inline int tracehook_single_step_enabled(struct task_struct *tsk)
57 {
58         struct pt_regs *pt = task_pt_regs(tsk);
59         return ia64_psr(pt)->ss;
60 }
61
62 static inline void tracehook_abort_syscall(struct pt_regs *regs)
63 {
64         regs->r15 = -1L;
65 }
66
67 extern const struct utrace_regset_view utrace_ia64_native;
68 static inline const struct utrace_regset_view *
69 utrace_native_view(struct task_struct *tsk)
70 {
71 #if 0 //CONFIG_IA32_SUPPORT
72         extern const struct utrace_regset_view utrace_ia32_view;
73
74         struct pt_regs *pt = task_pt_regs(tsk);
75         if (pt->cr_ipsr & IA64_PSR_IS)
76                 return &utrace_ia32_view;
77 #endif
78         return &utrace_ia64_native;
79 }
80
81 #endif