Commit 6c79759e authored by Paul Burton's avatar Paul Burton

MIPS: ptrace: Remove FP support when CONFIG_MIPS_FP_SUPPORT=n

When CONFIG_MIPS_FP_SUPPORT=n we don't support floating point, so remove
the related ptrace support. Besides removing code which should not be
needed, this prepares us for the removal of FPU state in struct
task_struct which this code requires.
Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21008/
Cc: linux-mips@linux-mips.org
parent 85164fd8
This diff is collapsed.
...@@ -82,7 +82,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -82,7 +82,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
/* Read the word at location addr in the USER area. */ /* Read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: { case PTRACE_PEEKUSR: {
struct pt_regs *regs; struct pt_regs *regs;
union fpureg *fregs;
unsigned int tmp; unsigned int tmp;
regs = task_pt_regs(child); regs = task_pt_regs(child);
...@@ -92,7 +91,10 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -92,7 +91,10 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
case 0 ... 31: case 0 ... 31:
tmp = regs->regs[addr]; tmp = regs->regs[addr];
break; break;
case FPR_BASE ... FPR_BASE + 31: #ifdef CONFIG_MIPS_FP_SUPPORT
case FPR_BASE ... FPR_BASE + 31: {
union fpureg *fregs;
if (!tsk_used_math(child)) { if (!tsk_used_math(child)) {
/* FP not yet used */ /* FP not yet used */
tmp = -1; tmp = -1;
...@@ -111,6 +113,15 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -111,6 +113,15 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
} }
tmp = get_fpr64(&fregs[addr - FPR_BASE], 0); tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
break; break;
}
case FPC_CSR:
tmp = child->thread.fpu.fcr31;
break;
case FPC_EIR:
/* implementation / version register */
tmp = boot_cpu_data.fpu_id;
break;
#endif /* CONFIG_MIPS_FP_SUPPORT */
case PC: case PC:
tmp = regs->cp0_epc; tmp = regs->cp0_epc;
break; break;
...@@ -126,13 +137,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -126,13 +137,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
case MMLO: case MMLO:
tmp = regs->lo; tmp = regs->lo;
break; break;
case FPC_CSR:
tmp = child->thread.fpu.fcr31;
break;
case FPC_EIR:
/* implementation / version register */
tmp = boot_cpu_data.fpu_id;
break;
case DSP_BASE ... DSP_BASE + 5: { case DSP_BASE ... DSP_BASE + 5: {
dspreg_t *dregs; dspreg_t *dregs;
...@@ -203,6 +207,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -203,6 +207,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
mips_syscall_is_indirect(child, regs)) mips_syscall_is_indirect(child, regs))
mips_syscall_update_nr(child, regs); mips_syscall_update_nr(child, regs);
break; break;
#ifdef CONFIG_MIPS_FP_SUPPORT
case FPR_BASE ... FPR_BASE + 31: { case FPR_BASE ... FPR_BASE + 31: {
union fpureg *fregs = get_fpu_regs(child); union fpureg *fregs = get_fpu_regs(child);
...@@ -225,6 +230,10 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -225,6 +230,10 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
set_fpr64(&fregs[addr - FPR_BASE], 0, data); set_fpr64(&fregs[addr - FPR_BASE], 0, data);
break; break;
} }
case FPC_CSR:
child->thread.fpu.fcr31 = data;
break;
#endif /* CONFIG_MIPS_FP_SUPPORT */
case PC: case PC:
regs->cp0_epc = data; regs->cp0_epc = data;
break; break;
...@@ -234,9 +243,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -234,9 +243,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
case MMLO: case MMLO:
regs->lo = data; regs->lo = data;
break; break;
case FPC_CSR:
child->thread.fpu.fcr31 = data;
break;
case DSP_BASE ... DSP_BASE + 5: { case DSP_BASE ... DSP_BASE + 5: {
dspreg_t *dregs; dspreg_t *dregs;
...@@ -274,6 +280,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -274,6 +280,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
(struct user_pt_regs __user *) (__u64) data); (struct user_pt_regs __user *) (__u64) data);
break; break;
#ifdef CONFIG_MIPS_FP_SUPPORT
case PTRACE_GETFPREGS: case PTRACE_GETFPREGS:
ret = ptrace_getfpregs(child, (__u32 __user *) (__u64) data); ret = ptrace_getfpregs(child, (__u32 __user *) (__u64) data);
break; break;
...@@ -281,7 +288,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -281,7 +288,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
case PTRACE_SETFPREGS: case PTRACE_SETFPREGS:
ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data); ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data);
break; break;
#endif
case PTRACE_GET_THREAD_AREA: case PTRACE_GET_THREAD_AREA:
ret = put_user(task_thread_info(child)->tp_value, ret = put_user(task_thread_info(child)->tp_value,
(unsigned int __user *) (unsigned long) data); (unsigned int __user *) (unsigned long) data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment