summaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/ptrace-common.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2005-09-10 16:01:11 +1000
committerPaul Mackerras <paulus@samba.org>2005-09-12 17:19:12 +1000
commitfd9648dff6f9797ecc509bcd181706a274dc074d (patch)
tree845b99905dc4f54171d554c14e45b55f1cfe48e2 /include/asm-ppc64/ptrace-common.h
parenta94d308513bdb2b926b45c11d7ce7fac6d6ca865 (diff)
downloadop-kernel-dev-fd9648dff6f9797ecc509bcd181706a274dc074d.zip
op-kernel-dev-fd9648dff6f9797ecc509bcd181706a274dc074d.tar.gz
[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 bd0f84c..b1babb7 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 */
OpenPOWER on IntegriCloud