2 * Tracing hooks, x86-64 CPU support
4 * Copyright (C) 2006, 2007 Red Hat, Inc. All rights reserved.
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.
10 * Red Hat Author: Roland McGrath.
13 #ifndef _ASM_TRACEHOOK_H
14 #define _ASM_TRACEHOOK_H 1
16 #include <linux/sched.h>
17 #include <asm/ptrace.h>
18 #include <asm/proto.h>
21 * See linux/tracehook.h for the descriptions of what these need to do.
24 #define ARCH_HAS_SINGLE_STEP (1)
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);
30 static inline int tracehook_single_step_enabled(struct task_struct *tsk)
32 return test_tsk_thread_flag(tsk, TIF_SINGLESTEP);
35 static inline void tracehook_enable_syscall_trace(struct task_struct *tsk)
37 set_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
40 static inline void tracehook_disable_syscall_trace(struct task_struct *tsk)
42 clear_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
45 static inline void tracehook_abort_syscall(struct pt_regs *regs)
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)
54 #ifdef CONFIG_IA32_EMULATION
55 if (test_tsk_thread_flag(tsk, TIF_IA32))
56 return &utrace_ia32_view;
58 return &utrace_x86_64_native;