s390/kernel: introduce fpu-internal.h with fpu helper functions

Introduce a new structure to manage FP and VX registers. Refactor the
save and restore of floating point and vector registers with a set
of helper functions in fpu-internal.h.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Hendrik Brueckner
2015-06-11 15:33:54 +02:00
committed by Martin Schwidefsky
parent 96b2d7a83a
commit 904818e2f2
9 changed files with 298 additions and 284 deletions

View File

@@ -81,8 +81,8 @@ void release_thread(struct task_struct *dead_task)
void arch_release_task_struct(struct task_struct *tsk)
{
if (tsk->thread.vxrs)
kfree(tsk->thread.vxrs);
if (is_vx_task(tsk))
kfree(tsk->thread.fpu.vxrs);
}
int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
@@ -143,10 +143,10 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
frame->childregs.psw.mask &= ~PSW_MASK_RI;
/* Save the fpu registers to new thread structure. */
save_fp_ctl(&p->thread.fp_regs.fpc);
save_fp_regs(p->thread.fp_regs.fprs);
p->thread.fp_regs.pad = 0;
p->thread.vxrs = NULL;
save_fp_ctl(&p->thread.fpu.fpc);
save_fp_regs(p->thread.fpu.fprs);
p->thread.fpu.pad = 0;
p->thread.fpu.vxrs = NULL;
/* Set a new TLS ? */
if (clone_flags & CLONE_SETTLS) {
unsigned long tls = frame->childregs.gprs[6];
@@ -162,7 +162,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
asmlinkage void execve_tail(void)
{
current->thread.fp_regs.fpc = 0;
current->thread.fpu.fpc = 0;
asm volatile("sfpc %0" : : "d" (0));
}