aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/ptrace_32.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-12 22:51:40 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-12 22:51:40 -0500
commit0ea820cf9bf58f735ed40ec67947159c4f170012 (patch)
tree77320006b4dded5804c678c1a869571be5c0b95f /arch/sh/kernel/ptrace_32.c
parenta3705799e2cc5fb69d88ad6a7f317a8f5597f18d (diff)
sh: Move over to dynamically allocated FPU context.
This follows the x86 xstate changes and implements a task_xstate slab cache that is dynamically sized to match one of hard FP/soft FP/FPU-less. This also tidies up and consolidates some of the SH-2A/SH-4 FPU fragmentation. Now fpu state restorers are commonly defined, with the init_fpu()/fpu_init() mess reworked to follow the x86 convention. The fpu_init() register initialization has been replaced by xstate setup followed by writing out to hardware via the standard restore path. As init_fpu() now performs a slab allocation a secondary lighterweight restorer is also introduced for the context switch. In the future the DSP state will be rolled in here, too. More work remains for math emulation and the SH-5 FPU, which presently uses its own special (UP-only) interfaces. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/ptrace_32.c')
-rw-r--r--arch/sh/kernel/ptrace_32.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index 9be35f348093..be9b5dcb4021 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -163,10 +163,10 @@ int fpregs_get(struct task_struct *target,
163 163
164 if ((boot_cpu_data.flags & CPU_HAS_FPU)) 164 if ((boot_cpu_data.flags & CPU_HAS_FPU))
165 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 165 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
166 &target->thread.fpu.hard, 0, -1); 166 &target->thread.xstate->hardfpu, 0, -1);
167 167
168 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 168 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
169 &target->thread.fpu.soft, 0, -1); 169 &target->thread.xstate->softfpu, 0, -1);
170} 170}
171 171
172static int fpregs_set(struct task_struct *target, 172static int fpregs_set(struct task_struct *target,
@@ -184,10 +184,10 @@ static int fpregs_set(struct task_struct *target,
184 184
185 if ((boot_cpu_data.flags & CPU_HAS_FPU)) 185 if ((boot_cpu_data.flags & CPU_HAS_FPU))
186 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 186 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
187 &target->thread.fpu.hard, 0, -1); 187 &target->thread.xstate->hardfpu, 0, -1);
188 188
189 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 189 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
190 &target->thread.fpu.soft, 0, -1); 190 &target->thread.xstate->softfpu, 0, -1);
191} 191}
192 192
193static int fpregs_active(struct task_struct *target, 193static int fpregs_active(struct task_struct *target,
@@ -333,7 +333,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
333 else 333 else
334 tmp = 0; 334 tmp = 0;
335 } else 335 } else
336 tmp = ((long *)&child->thread.fpu) 336 tmp = ((long *)child->thread.xstate)
337 [(addr - (long)&dummy->fpu) >> 2]; 337 [(addr - (long)&dummy->fpu) >> 2];
338 } else if (addr == (long) &dummy->u_fpvalid) 338 } else if (addr == (long) &dummy->u_fpvalid)
339 tmp = !!tsk_used_math(child); 339 tmp = !!tsk_used_math(child);
@@ -362,7 +362,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
362 else if (addr >= (long) &dummy->fpu && 362 else if (addr >= (long) &dummy->fpu &&
363 addr < (long) &dummy->u_fpvalid) { 363 addr < (long) &dummy->u_fpvalid) {
364 set_stopped_child_used_math(child); 364 set_stopped_child_used_math(child);
365 ((long *)&child->thread.fpu) 365 ((long *)child->thread.xstate)
366 [(addr - (long)&dummy->fpu) >> 2] = data; 366 [(addr - (long)&dummy->fpu) >> 2] = data;
367 ret = 0; 367 ret = 0;
368 } else if (addr == (long) &dummy->u_fpvalid) { 368 } else if (addr == (long) &dummy->u_fpvalid) {