summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2015-06-11 16:57:20 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-07-22 09:58:00 +0200
commit155e839a814834a3b4b31e729f4716e59d3d2dd4 (patch)
treee23d3bd009812c8a46caa418d42bf2a18ec6d39c /arch/s390/include/asm
parent904818e2f229f3d94ec95f6932a6358c81e73d78 (diff)
s390/kernel: dynamically allocate FP register save area
Make the floating-point save area dynamically allocated and uses a flag to distinguish whether a task uses floating-point or vector registers. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm')
-rw-r--r--arch/s390/include/asm/fpu-internal.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/s390/include/asm/fpu-internal.h b/arch/s390/include/asm/fpu-internal.h
index 04b4cfc08fb5..cc44c75fc4f7 100644
--- a/arch/s390/include/asm/fpu-internal.h
+++ b/arch/s390/include/asm/fpu-internal.h
@@ -8,6 +8,10 @@
#ifndef _ASM_S390_FPU_INTERNAL_H
#define _ASM_S390_FPU_INTERNAL_H
+#define FPU_USE_VX 1 /* Vector extension is active */
+
+#ifndef __ASSEMBLY__
+
#include <linux/errno.h>
#include <linux/string.h>
#include <asm/linkage.h>
@@ -16,13 +20,16 @@
struct fpu {
__u32 fpc; /* Floating-point control */
- __u32 pad;
- freg_t fprs[__NUM_FPRS]; /* Floating-point register save area */
- __vector128 *vxrs; /* Vector register save area */
+ __u32 flags;
+ union {
+ void *regs;
+ freg_t *fprs; /* Floating-point register save area */
+ __vector128 *vxrs; /* Vector register save area */
+ };
};
-#define is_vx_fpu(fpu) (!!(fpu)->vxrs)
-#define is_vx_task(tsk) (!!(tsk)->thread.fpu.vxrs)
+#define is_vx_fpu(fpu) (!!((fpu)->flags & FPU_USE_VX))
+#define is_vx_task(tsk) (!!((tsk)->thread.fpu.flags & FPU_USE_VX))
static inline int test_fp_ctl(u32 fpc)
{
@@ -188,4 +195,6 @@ static inline void restore_fpu_regs(struct fpu *fpu)
restore_fp_regs(fpu->fprs);
}
+#endif
+
#endif /* _ASM_S390_FPU_INTERNAL_H */