diff options
author | Anton Blanchard <anton@samba.org> | 2005-09-10 02:01:11 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-12 03:19:12 -0400 |
commit | fd9648dff6f9797ecc509bcd181706a274dc074d (patch) | |
tree | 845b99905dc4f54171d554c14e45b55f1cfe48e2 /include/asm-ppc64/ptrace-common.h | |
parent | a94d308513bdb2b926b45c11d7ce7fac6d6ca865 (diff) |
[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.h | 20 |
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 @@ | |||
13 | #define _PPC64_PTRACE_COMMON_H | 13 | #define _PPC64_PTRACE_COMMON_H |
14 | 14 | ||
15 | #include <linux/config.h> | 15 | #include <linux/config.h> |
16 | #include <asm/system.h> | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * Set of msr bits that gdb can change on behalf of a process. | 19 | * 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, | |||
141 | } | 142 | } |
142 | #endif | 143 | #endif |
143 | 144 | ||
145 | static inline int ptrace_set_debugreg(struct task_struct *task, | ||
146 | unsigned long addr, unsigned long data) | ||
147 | { | ||
148 | /* We only support one DABR and no IABRS at the moment */ | ||
149 | if (addr > 0) | ||
150 | return -EINVAL; | ||
151 | |||
152 | /* The bottom 3 bits are flags */ | ||
153 | if ((data & ~0x7UL) >= TASK_SIZE) | ||
154 | return -EIO; | ||
155 | |||
156 | /* Ensure translation is on */ | ||
157 | if (data && !(data & DABR_TRANSLATION)) | ||
158 | return -EIO; | ||
159 | |||
160 | task->thread.dabr = data; | ||
161 | return 0; | ||
162 | } | ||
163 | |||
144 | #endif /* _PPC64_PTRACE_COMMON_H */ | 164 | #endif /* _PPC64_PTRACE_COMMON_H */ |