diff options
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 */ |