diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-05-15 12:26:03 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-06-19 12:39:18 -0400 |
commit | eae89076e696f51762d81d6e2538c3beb59fa7bd (patch) | |
tree | 7aab0972d6786721eb6c9b01d77a1b5f13263c49 /arch/mips/kernel/ptrace.c | |
parent | 5deee2dbf495b2693629f7e8f846483432096278 (diff) |
[MIPS] Unify mips_fpu_soft_struct and mips_fpu_hard_structs.
The struct mips_fpu_soft_struct and mips_fpu_hard_struct are
completely same now and the kernel fpu emulator assumes that. This
patch unifies them to mips_fpu_struct and get rid of mips_fpu_union.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
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 | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 9b4733c12395..1d44025188d8 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
@@ -120,11 +120,11 @@ int ptrace_getfpregs (struct task_struct *child, __u32 __user *data) | |||
120 | __put_user ((__u64) -1, i + (__u64 __user *) data); | 120 | __put_user ((__u64) -1, i + (__u64 __user *) data); |
121 | } | 121 | } |
122 | 122 | ||
123 | __put_user (child->thread.fpu.fcr31, data + 64); | ||
124 | |||
123 | if (cpu_has_fpu) { | 125 | if (cpu_has_fpu) { |
124 | unsigned int flags, tmp; | 126 | unsigned int flags, tmp; |
125 | 127 | ||
126 | __put_user (child->thread.fpu.hard.fcr31, data + 64); | ||
127 | |||
128 | preempt_disable(); | 128 | preempt_disable(); |
129 | if (cpu_has_mipsmt) { | 129 | if (cpu_has_mipsmt) { |
130 | unsigned int vpflags = dvpe(); | 130 | unsigned int vpflags = dvpe(); |
@@ -142,7 +142,6 @@ int ptrace_getfpregs (struct task_struct *child, __u32 __user *data) | |||
142 | preempt_enable(); | 142 | preempt_enable(); |
143 | __put_user (tmp, data + 65); | 143 | __put_user (tmp, data + 65); |
144 | } else { | 144 | } else { |
145 | __put_user (child->thread.fpu.soft.fcr31, data + 64); | ||
146 | __put_user ((__u32) 0, data + 65); | 145 | __put_user ((__u32) 0, data + 65); |
147 | } | 146 | } |
148 | 147 | ||
@@ -162,10 +161,7 @@ int ptrace_setfpregs (struct task_struct *child, __u32 __user *data) | |||
162 | for (i = 0; i < 32; i++) | 161 | for (i = 0; i < 32; i++) |
163 | __get_user (fregs[i], i + (__u64 __user *) data); | 162 | __get_user (fregs[i], i + (__u64 __user *) data); |
164 | 163 | ||
165 | if (cpu_has_fpu) | 164 | __get_user (child->thread.fpu.fcr31, data + 64); |
166 | __get_user (child->thread.fpu.hard.fcr31, data + 64); | ||
167 | else | ||
168 | __get_user (child->thread.fpu.soft.fcr31, data + 64); | ||
169 | 165 | ||
170 | /* FIR may not be written. */ | 166 | /* FIR may not be written. */ |
171 | 167 | ||
@@ -241,10 +237,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
241 | tmp = regs->lo; | 237 | tmp = regs->lo; |
242 | break; | 238 | break; |
243 | case FPC_CSR: | 239 | case FPC_CSR: |
244 | if (cpu_has_fpu) | 240 | tmp = child->thread.fpu.fcr31; |
245 | tmp = child->thread.fpu.hard.fcr31; | ||
246 | else | ||
247 | tmp = child->thread.fpu.soft.fcr31; | ||
248 | break; | 241 | break; |
249 | case FPC_EIR: { /* implementation / version register */ | 242 | case FPC_EIR: { /* implementation / version register */ |
250 | unsigned int flags; | 243 | unsigned int flags; |
@@ -336,9 +329,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
336 | 329 | ||
337 | if (!tsk_used_math(child)) { | 330 | if (!tsk_used_math(child)) { |
338 | /* FP not yet used */ | 331 | /* FP not yet used */ |
339 | memset(&child->thread.fpu.hard, ~0, | 332 | memset(&child->thread.fpu, ~0, |
340 | sizeof(child->thread.fpu.hard)); | 333 | sizeof(child->thread.fpu)); |
341 | child->thread.fpu.hard.fcr31 = 0; | 334 | child->thread.fpu.fcr31 = 0; |
342 | } | 335 | } |
343 | #ifdef CONFIG_32BIT | 336 | #ifdef CONFIG_32BIT |
344 | /* | 337 | /* |
@@ -369,10 +362,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
369 | regs->lo = data; | 362 | regs->lo = data; |
370 | break; | 363 | break; |
371 | case FPC_CSR: | 364 | case FPC_CSR: |
372 | if (cpu_has_fpu) | 365 | child->thread.fpu.fcr31 = data; |
373 | child->thread.fpu.hard.fcr31 = data; | ||
374 | else | ||
375 | child->thread.fpu.soft.fcr31 = data; | ||
376 | break; | 366 | break; |
377 | case DSP_BASE ... DSP_BASE + 5: { | 367 | case DSP_BASE ... DSP_BASE + 5: { |
378 | dspreg_t *dregs; | 368 | dspreg_t *dregs; |