aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/ptrace32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/ptrace32.c')
-rw-r--r--arch/mips/kernel/ptrace32.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index eb446e525908..5c45a5880226 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -26,6 +26,7 @@
26#include <linux/security.h> 26#include <linux/security.h>
27 27
28#include <asm/cpu.h> 28#include <asm/cpu.h>
29#include <asm/dsp.h>
29#include <asm/fpu.h> 30#include <asm/fpu.h>
30#include <asm/mipsregs.h> 31#include <asm/mipsregs.h>
31#include <asm/pgtable.h> 32#include <asm/pgtable.h>
@@ -161,6 +162,27 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
161 write_c0_status(flags); 162 write_c0_status(flags);
162 break; 163 break;
163 } 164 }
165 case DSP_BASE ... DSP_BASE + 5:
166 if (!cpu_has_dsp) {
167 tmp = 0;
168 ret = -EIO;
169 goto out_tsk;
170 }
171 if (child->thread.dsp.used_dsp) {
172 dspreg_t *dregs = __get_dsp_regs(child);
173 tmp = (unsigned long) (dregs[addr - DSP_BASE]);
174 } else {
175 tmp = -1; /* DSP registers yet used */
176 }
177 break;
178 case DSP_CONTROL:
179 if (!cpu_has_dsp) {
180 tmp = 0;
181 ret = -EIO;
182 goto out_tsk;
183 }
184 tmp = child->thread.dsp.dspcontrol;
185 break;
164 default: 186 default:
165 tmp = 0; 187 tmp = 0;
166 ret = -EIO; 188 ret = -EIO;
@@ -230,6 +252,22 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
230 else 252 else
231 child->thread.fpu.soft.fcr31 = data; 253 child->thread.fpu.soft.fcr31 = data;
232 break; 254 break;
255 case DSP_BASE ... DSP_BASE + 5:
256 if (!cpu_has_dsp) {
257 ret = -EIO;
258 break;
259 }
260
261 dspreg_t *dregs = __get_dsp_regs(child);
262 dregs[addr - DSP_BASE] = data;
263 break;
264 case DSP_CONTROL:
265 if (!cpu_has_dsp) {
266 ret = -EIO;
267 break;
268 }
269 child->thread.dsp.dspcontrol = data;
270 break;
233 default: 271 default:
234 /* The rest are not allowed. */ 272 /* The rest are not allowed. */
235 ret = -EIO; 273 ret = -EIO;