summaryrefslogtreecommitdiff
path: root/include/asm-ppc64/ptrace-common.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-09-10 10:01:11 +0400
committerPaul Mackerras <paulus@samba.org>2005-09-12 11:19:12 +0400
commitfd9648dff6f9797ecc509bcd181706a274dc074d (patch)
tree845b99905dc4f54171d554c14e45b55f1cfe48e2 /include/asm-ppc64/ptrace-common.h
parenta94d308513bdb2b926b45c11d7ce7fac6d6ca865 (diff)
downloadlinux-fd9648dff6f9797ecc509bcd181706a274dc074d.tar.xz
[PATCH] ppc64: Add ptrace data breakpoint support
Add hardware data breakpoint support. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc64/ptrace-common.h')
-rw-r--r--include/asm-ppc64/ptrace-common.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/asm-ppc64/ptrace-common.h b/include/asm-ppc64/ptrace-common.h
index bd0f84c27bd0..b1babb729673 100644
--- a/include/asm-ppc64/ptrace-common.h
+++ b/include/asm-ppc64/ptrace-common.h
@@ -13,6 +13,7 @@
#define _PPC64_PTRACE_COMMON_H
#include <linux/config.h>
+#include <asm/system.h>
/*
* Set of msr bits that gdb can change on behalf of a process.
@@ -141,4 +142,23 @@ static inline int set_vrregs(struct task_struct *task,
}
#endif
+static inline int ptrace_set_debugreg(struct task_struct *task,
+ unsigned long addr, unsigned long data)
+{
+ /* We only support one DABR and no IABRS at the moment */
+ if (addr > 0)
+ return -EINVAL;
+
+ /* The bottom 3 bits are flags */
+ if ((data & ~0x7UL) >= TASK_SIZE)
+ return -EIO;
+
+ /* Ensure translation is on */
+ if (data && !(data & DABR_TRANSLATION))
+ return -EIO;
+
+ task->thread.dabr = data;
+ return 0;
+}
+
#endif /* _PPC64_PTRACE_COMMON_H */