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.
6 * Tracing hooks, ia64 CPU support
9 #ifndef _ASM_TRACEHOOK_H
10 #define _ASM_TRACEHOOK_H 1
12 #include <linux/sched.h>
13 #include <asm/ptrace.h>
16 * See linux/tracehook.h for the descriptions of what these need to do.
19 #define ARCH_HAS_SINGLE_STEP (1)
20 #define ARCH_HAS_BLOCK_STEP (1)
22 static inline void tracehook_enable_single_step(struct task_struct *tsk)
24 struct pt_regs *pt = task_pt_regs(tsk);
26 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
29 static inline void tracehook_disable_single_step(struct task_struct *tsk)
31 struct pt_regs *pt = task_pt_regs(tsk);
33 if (ia64_psr(pt)->tb == 0)
34 clear_tsk_thread_flag(tsk, TIF_SINGLESTEP);
37 static inline void tracehook_enable_block_step(struct task_struct *tsk)
39 struct pt_regs *pt = task_pt_regs(tsk);
41 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
44 static inline void tracehook_disable_block_step(struct task_struct *tsk)
46 struct pt_regs *pt = task_pt_regs(tsk);
48 if (ia64_psr(pt)->ss == 0)
49 clear_tsk_thread_flag(tsk, TIF_SINGLESTEP);
52 static inline void tracehook_enable_syscall_trace(struct task_struct *tsk)
54 set_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
57 static inline void tracehook_disable_syscall_trace(struct task_struct *tsk)
59 clear_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
62 static inline int tracehook_single_step_enabled(struct task_struct *tsk)
64 struct pt_regs *pt = task_pt_regs(tsk);
65 return ia64_psr(pt)->ss;
68 static inline void tracehook_abort_syscall(struct pt_regs *regs)
70 if (IS_IA32_PROCESS(regs))
76 extern const struct utrace_regset_view utrace_ia64_native;
77 static inline const struct utrace_regset_view *
78 utrace_native_view(struct task_struct *tsk)
80 #ifdef CONFIG_IA32_SUPPORT
81 extern const struct utrace_regset_view utrace_ia32_view;
82 if (IS_IA32_PROCESS(task_pt_regs(tsk)))
83 return &utrace_ia32_view;
85 return &utrace_ia64_native;
89 #endif /* asm/tracehook.h */