xref: /linux/arch/s390/include/asm/fpu-types.h (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * FPU data structures
4  *
5  * Copyright IBM Corp. 2015
6  * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
7  */
8 
9 #ifndef _ASM_S390_FPU_TYPES_H
10 #define _ASM_S390_FPU_TYPES_H
11 
12 #include <asm/sigcontext.h>
13 
14 struct fpu {
15 	u32 fpc;
16 	__vector128 vxrs[__NUM_VXRS] __aligned(8);
17 };
18 
19 struct kernel_fpu_hdr {
20 	int	mask;
21 	u32	fpc;
22 };
23 
24 struct kernel_fpu {
25 	struct kernel_fpu_hdr hdr;
26 	__vector128 vxrs[] __aligned(8);
27 };
28 
29 #define KERNEL_FPU_STRUCT(vxr_size)				\
30 struct kernel_fpu_##vxr_size {					\
31 	struct kernel_fpu_hdr hdr;				\
32 	__vector128 vxrs[vxr_size] __aligned(8);		\
33 }
34 
35 KERNEL_FPU_STRUCT(8);
36 KERNEL_FPU_STRUCT(16);
37 KERNEL_FPU_STRUCT(32);
38 
39 #define DECLARE_KERNEL_FPU_ONSTACK(vxr_size, name)		\
40 	struct kernel_fpu_##vxr_size name __uninitialized
41 
42 #define DECLARE_KERNEL_FPU_ONSTACK8(name)			\
43 	DECLARE_KERNEL_FPU_ONSTACK(8, name)
44 
45 #define DECLARE_KERNEL_FPU_ONSTACK16(name)			\
46 	DECLARE_KERNEL_FPU_ONSTACK(16, name)
47 
48 #define DECLARE_KERNEL_FPU_ONSTACK32(name)			\
49 	DECLARE_KERNEL_FPU_ONSTACK(32, name)
50 
51 #endif /* _ASM_S390_FPU_TYPES_H */
52