diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-05-31 07:49:19 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:31:17 -0400 |
commit | e50c0a8fa60da9ac0e0a70caa8a3a803815c1f2f (patch) | |
tree | 1928e8b0a4b7fb615e5a9f65dc934ba2e74cb9cd /arch/mips/kernel/ptrace.c | |
parent | 10f650db1bcc193ea07d4f8c2f07315da38ea0c4 (diff) |
Support the MIPS32 / MIPS64 DSP ASE.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/ptrace.c')
-rw-r--r-- | arch/mips/kernel/ptrace.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 49821ee18984..2441e32ce820 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | #include <asm/byteorder.h> | 31 | #include <asm/byteorder.h> |
32 | #include <asm/cpu.h> | 32 | #include <asm/cpu.h> |
33 | #include <asm/dsp.h> | ||
33 | #include <asm/fpu.h> | 34 | #include <asm/fpu.h> |
34 | #include <asm/mipsregs.h> | 35 | #include <asm/mipsregs.h> |
35 | #include <asm/pgtable.h> | 36 | #include <asm/pgtable.h> |
@@ -176,6 +177,27 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) | |||
176 | write_c0_status(flags); | 177 | write_c0_status(flags); |
177 | break; | 178 | break; |
178 | } | 179 | } |
180 | case DSP_BASE ... DSP_BASE + 5: | ||
181 | if (!cpu_has_dsp) { | ||
182 | tmp = 0; | ||
183 | ret = -EIO; | ||
184 | goto out_tsk; | ||
185 | } | ||
186 | if (child->thread.dsp.used_dsp) { | ||
187 | dspreg_t *dregs = __get_dsp_regs(child); | ||
188 | tmp = (unsigned long) (dregs[addr - DSP_BASE]); | ||
189 | } else { | ||
190 | tmp = -1; /* DSP registers yet used */ | ||
191 | } | ||
192 | break; | ||
193 | case DSP_CONTROL: | ||
194 | if (!cpu_has_dsp) { | ||
195 | tmp = 0; | ||
196 | ret = -EIO; | ||
197 | goto out_tsk; | ||
198 | } | ||
199 | tmp = child->thread.dsp.dspcontrol; | ||
200 | break; | ||
179 | default: | 201 | default: |
180 | tmp = 0; | 202 | tmp = 0; |
181 | ret = -EIO; | 203 | ret = -EIO; |
@@ -248,6 +270,22 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) | |||
248 | else | 270 | else |
249 | child->thread.fpu.soft.fcr31 = data; | 271 | child->thread.fpu.soft.fcr31 = data; |
250 | break; | 272 | break; |
273 | case DSP_BASE ... DSP_BASE + 5: | ||
274 | if (!cpu_has_dsp) { | ||
275 | ret = -EIO; | ||
276 | break; | ||
277 | } | ||
278 | |||
279 | dspreg_t *dregs = __get_dsp_regs(child); | ||
280 | dregs[addr - DSP_BASE] = data; | ||
281 | break; | ||
282 | case DSP_CONTROL: | ||
283 | if (!cpu_has_dsp) { | ||
284 | ret = -EIO; | ||
285 | break; | ||
286 | } | ||
287 | child->thread.dsp.dspcontrol = data; | ||
288 | break; | ||
251 | default: | 289 | default: |
252 | /* The rest are not allowed. */ | 290 | /* The rest are not allowed. */ |
253 | ret = -EIO; | 291 | ret = -EIO; |