fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / asm-s390 / tracehook.h
1 /*
2  * Tracing hooks, s390/s390x 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
19 /*
20  * See linux/tracehook.h for the descriptions of what these need to do.
21  */
22
23 #define ARCH_HAS_SINGLE_STEP    (1)
24
25 /* These three are defined in arch/s390/kernel/ptrace.c.  */
26 void tracehook_enable_single_step(struct task_struct *tsk);
27 void tracehook_disable_single_step(struct task_struct *tsk);
28 int tracehook_single_step_enabled(struct task_struct *tsk);
29
30
31 static inline void tracehook_enable_syscall_trace(struct task_struct *tsk)
32 {
33         set_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
34 }
35
36 static inline void tracehook_disable_syscall_trace(struct task_struct *tsk)
37 {
38         clear_tsk_thread_flag(tsk, TIF_SYSCALL_TRACE);
39 }
40
41 static inline void tracehook_abort_syscall(struct pt_regs *regs)
42 {
43         regs->gprs[2] = -1L;
44 }
45
46
47 extern const struct utrace_regset_view utrace_s390_native_view;
48 static inline const struct utrace_regset_view *
49 utrace_native_view(struct task_struct *tsk)
50 {
51 #ifdef CONFIG_COMPAT
52         extern const struct utrace_regset_view utrace_s390_compat_view;
53
54         if (test_tsk_thread_flag(tsk, TIF_31BIT))
55                 return &utrace_s390_compat_view;
56 #endif
57         return &utrace_s390_native_view;
58 }
59
60
61 #endif