From fd9648dff6f9797ecc509bcd181706a274dc074d Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Sat, 10 Sep 2005 16:01:11 +1000 Subject: [PATCH] ppc64: Add ptrace data breakpoint support Add hardware data breakpoint support. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/ptrace-common.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/asm-ppc64/ptrace-common.h') diff --git a/include/asm-ppc64/ptrace-common.h b/include/asm-ppc64/ptrace-common.h index bd0f84c27bd..b1babb72967 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 +#include /* * 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 */ -- cgit v1.2.3