hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/mips/kernel/ptrace32.c
....@@ -30,7 +30,6 @@
3030 #include <asm/fpu.h>
3131 #include <asm/mipsregs.h>
3232 #include <asm/mipsmtregs.h>
33
-#include <asm/pgtable.h>
3433 #include <asm/page.h>
3534 #include <asm/reg.h>
3635 #include <asm/syscall.h>
....@@ -82,7 +81,6 @@
8281 /* Read the word at location addr in the USER area. */
8382 case PTRACE_PEEKUSR: {
8483 struct pt_regs *regs;
85
- union fpureg *fregs;
8684 unsigned int tmp;
8785
8886 regs = task_pt_regs(child);
....@@ -92,7 +90,10 @@
9290 case 0 ... 31:
9391 tmp = regs->regs[addr];
9492 break;
95
- case FPR_BASE ... FPR_BASE + 31:
93
+#ifdef CONFIG_MIPS_FP_SUPPORT
94
+ case FPR_BASE ... FPR_BASE + 31: {
95
+ union fpureg *fregs;
96
+
9697 if (!tsk_used_math(child)) {
9798 /* FP not yet used */
9899 tmp = -1;
....@@ -111,6 +112,15 @@
111112 }
112113 tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
113114 break;
115
+ }
116
+ case FPC_CSR:
117
+ tmp = child->thread.fpu.fcr31;
118
+ break;
119
+ case FPC_EIR:
120
+ /* implementation / version register */
121
+ tmp = boot_cpu_data.fpu_id;
122
+ break;
123
+#endif /* CONFIG_MIPS_FP_SUPPORT */
114124 case PC:
115125 tmp = regs->cp0_epc;
116126 break;
....@@ -125,13 +135,6 @@
125135 break;
126136 case MMLO:
127137 tmp = regs->lo;
128
- break;
129
- case FPC_CSR:
130
- tmp = child->thread.fpu.fcr31;
131
- break;
132
- case FPC_EIR:
133
- /* implementation / version register */
134
- tmp = boot_cpu_data.fpu_id;
135138 break;
136139 case DSP_BASE ... DSP_BASE + 5: {
137140 dspreg_t *dregs;
....@@ -203,6 +206,7 @@
203206 mips_syscall_is_indirect(child, regs))
204207 mips_syscall_update_nr(child, regs);
205208 break;
209
+#ifdef CONFIG_MIPS_FP_SUPPORT
206210 case FPR_BASE ... FPR_BASE + 31: {
207211 union fpureg *fregs = get_fpu_regs(child);
208212
....@@ -225,6 +229,10 @@
225229 set_fpr64(&fregs[addr - FPR_BASE], 0, data);
226230 break;
227231 }
232
+ case FPC_CSR:
233
+ child->thread.fpu.fcr31 = data;
234
+ break;
235
+#endif /* CONFIG_MIPS_FP_SUPPORT */
228236 case PC:
229237 regs->cp0_epc = data;
230238 break;
....@@ -233,9 +241,6 @@
233241 break;
234242 case MMLO:
235243 regs->lo = data;
236
- break;
237
- case FPC_CSR:
238
- child->thread.fpu.fcr31 = data;
239244 break;
240245 case DSP_BASE ... DSP_BASE + 5: {
241246 dspreg_t *dregs;
....@@ -274,6 +279,7 @@
274279 (struct user_pt_regs __user *) (__u64) data);
275280 break;
276281
282
+#ifdef CONFIG_MIPS_FP_SUPPORT
277283 case PTRACE_GETFPREGS:
278284 ret = ptrace_getfpregs(child, (__u32 __user *) (__u64) data);
279285 break;
....@@ -281,7 +287,7 @@
281287 case PTRACE_SETFPREGS:
282288 ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data);
283289 break;
284
-
290
+#endif
285291 case PTRACE_GET_THREAD_AREA:
286292 ret = put_user(task_thread_info(child)->tp_value,
287293 (unsigned int __user *) (unsigned long) data);