2 * Tracing hooks, PowerPC CPU support
5 #ifndef _ASM_TRACEHOOK_H
6 #define _ASM_TRACEHOOK_H 1
8 #include <linux/sched.h>
9 #include <asm/ptrace.h>
12 * See linux/tracehook.h for the descriptions of what these need to do.
15 #define ARCH_HAS_SINGLE_STEP (1)
17 static inline void tracehook_enable_single_step(struct task_struct *task)
19 struct pt_regs *regs = task->thread.regs;
21 #if defined(CONFIG_PPC32) && (defined(CONFIG_40x) || defined(CONFIG_BOOKE))
22 task->thread.dbcr0 = DBCR0_IDM | DBCR0_IC;
28 set_tsk_thread_flag(task, TIF_SINGLESTEP);
31 static inline void tracehook_disable_single_step(struct task_struct *task)
33 struct pt_regs *regs = task->thread.regs;
35 #if defined(CONFIG_PPC32) && (defined(CONFIG_40x) || defined(CONFIG_BOOKE))
36 task->thread.dbcr0 = 0;
42 clear_tsk_thread_flag(task, TIF_SINGLESTEP);
45 static inline int tracehook_single_step_enabled(struct task_struct *tsk)
47 return test_tsk_thread_flag(tsk, TIF_SINGLESTEP);
50 static inline void tracehook_enable_syscall_trace(struct task_struct *tsk)
52 set_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
55 static inline void tracehook_disable_syscall_trace(struct task_struct *tsk)
57 clear_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
60 static inline void tracehook_abort_syscall(struct pt_regs *regs)
62 regs->orig_gpr3 = -1L;
66 extern const struct utrace_regset_view utrace_ppc_native_view;
67 static inline const struct utrace_regset_view *
68 utrace_native_view(struct task_struct *tsk)
71 extern const struct utrace_regset_view utrace_ppc32_view;
73 if (test_tsk_thread_flag(tsk, TIF_32BIT))
74 return &utrace_ppc32_view;
76 return &utrace_ppc_native_view;