diff options
author | David Smith <dsmith@redhat.com> | 2009-05-21 16:57:04 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2009-05-21 16:57:04 -0500 |
commit | c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b (patch) | |
tree | ab2388afb795ed1a7ead2fbbf8b9d1b368a8231f /runtime/ptrace_compatibility.h | |
parent | dd9a3bcbef65bde65491d959e9458bc641924811 (diff) | |
parent | 3863e7999255deeaa7f8f4bba7df893773812537 (diff) | |
download | systemtap-steved-c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b.tar.gz systemtap-steved-c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b.tar.xz systemtap-steved-c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b.zip |
Merge commit 'origin/master' into pr7043
Conflicts:
runtime/print.c
runtime/transport/transport.c
runtime/transport/transport_msgs.h
Diffstat (limited to 'runtime/ptrace_compatibility.h')
-rw-r--r-- | runtime/ptrace_compatibility.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/runtime/ptrace_compatibility.h b/runtime/ptrace_compatibility.h new file mode 100644 index 00000000..939c3b56 --- /dev/null +++ b/runtime/ptrace_compatibility.h @@ -0,0 +1,50 @@ +#ifndef _PTRACE_COMPATIBILITY_H_ +#define _PTRACE_COMPATIBILITY_H_ + +#include <linux/ptrace.h> + +/* Older kernel's linux/ptrace.h don't define + * arch_has_single_step()/arch_has_block_step(). */ + +#ifndef arch_has_single_step + +#include <linux/tracehook.h> + +/** + * arch_has_single_step - does this CPU support user-mode single-step? + * + * If this is defined, then there must be function declarations or + * inlines for user_enable_single_step() and user_disable_single_step(). + * arch_has_single_step() should evaluate to nonzero iff the machine + * supports instruction single-step for user mode. + * It can be a constant or it can test a CPU feature bit. + */ + +#ifdef ARCH_HAS_SINGLE_STEP +#define arch_has_single_step() (ARCH_HAS_SINGLE_STEP) +#else +#define arch_has_single_step() (0) +#endif /* ARCH_HAS_SINGLE_STEP */ + +#endif /* arch_has_single_step */ + +#ifndef arch_has_block_step +/** + * arch_has_block_step - does this CPU support user-mode block-step? + * + * If this is defined, then there must be a function declaration or inline + * for user_enable_block_step(), and arch_has_single_step() must be defined + * too. arch_has_block_step() should evaluate to nonzero iff the machine + * supports step-until-branch for user mode. It can be a constant or it + * can test a CPU feature bit. + */ + +#ifdef ARCH_HAS_BLOCK_STEP +#define arch_has_block_step() (ARCH_HAS_BLOCK_STEP) +#else +#define arch_has_block_step() (0) +#endif /* ARCH_HAS_BLOCK_STEP */ + +#endif /* arch_has_block_step */ + +#endif /* _PTRACE_COMPATIBILITY_H_ */ |