Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/fpu: split fpu-internal.h into fpu internals, api, and type headers

Split the API and FPU type definitions into separate header files
similar to "x86/fpu: Rename fpu-internal.h to fpu/internal.h" (78f7f1e54b).

The new header files and their meaning are:

asm/fpu/types.h:
FPU related data types, needed for 'struct thread_struct' and
'struct task_struct'.

asm/fpu/api.h:
FPU related 'public' functions for other subsystems and device
drivers.

asm/fpu/internal.h:
FPU internal functions mainly used to convert
FPU register contents in signal handling.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Hendrik Brueckner and committed by
Martin Schwidefsky
b0753902 6933c35a

+64 -42
+2 -35
arch/s390/include/asm/fpu-internal.h arch/s390/include/asm/fpu/internal.h
··· 1 1 /* 2 - * General floating pointer and vector register helpers 2 + * FPU state and register content conversion primitives 3 3 * 4 4 * Copyright IBM Corp. 2015 5 5 * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> ··· 8 8 #ifndef _ASM_S390_FPU_INTERNAL_H 9 9 #define _ASM_S390_FPU_INTERNAL_H 10 10 11 - #include <linux/errno.h> 12 11 #include <linux/string.h> 13 - #include <asm/linkage.h> 14 12 #include <asm/ctl_reg.h> 15 - #include <asm/sigcontext.h> 16 - 17 - struct fpu { 18 - __u32 fpc; /* Floating-point control */ 19 - union { 20 - void *regs; 21 - freg_t *fprs; /* Floating-point register save area */ 22 - __vector128 *vxrs; /* Vector register save area */ 23 - }; 24 - }; 25 - 26 - void save_fpu_regs(void); 27 - 28 - /* VX array structure for address operand constraints in inline assemblies */ 29 - struct vx_array { __vector128 _[__NUM_VXRS]; }; 30 - 31 - static inline int test_fp_ctl(u32 fpc) 32 - { 33 - u32 orig_fpc; 34 - int rc; 35 - 36 - asm volatile( 37 - " efpc %1\n" 38 - " sfpc %2\n" 39 - "0: sfpc %1\n" 40 - " la %0,0\n" 41 - "1:\n" 42 - EX_TABLE(0b,1b) 43 - : "=d" (rc), "=d" (orig_fpc) 44 - : "d" (fpc), "0" (-EINVAL)); 45 - return rc; 46 - } 13 + #include <asm/fpu/types.h> 47 14 48 15 static inline void save_vx_regs_safe(__vector128 *vxrs) 49 16 {
+30
arch/s390/include/asm/fpu/api.h
··· 1 + /* 2 + * In-kernel FPU support functions 3 + * 4 + * Copyright IBM Corp. 2015 5 + * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> 6 + */ 7 + 8 + #ifndef _ASM_S390_FPU_API_H 9 + #define _ASM_S390_FPU_API_H 10 + 11 + void save_fpu_regs(void); 12 + 13 + static inline int test_fp_ctl(u32 fpc) 14 + { 15 + u32 orig_fpc; 16 + int rc; 17 + 18 + asm volatile( 19 + " efpc %1\n" 20 + " sfpc %2\n" 21 + "0: sfpc %1\n" 22 + " la %0,0\n" 23 + "1:\n" 24 + EX_TABLE(0b,1b) 25 + : "=d" (rc), "=d" (orig_fpc) 26 + : "d" (fpc), "0" (-EINVAL)); 27 + return rc; 28 + } 29 + 30 + #endif /* _ASM_S390_FPU_API_H */
+25
arch/s390/include/asm/fpu/types.h
··· 1 + /* 2 + * FPU data structures 3 + * 4 + * Copyright IBM Corp. 2015 5 + * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com> 6 + */ 7 + 8 + #ifndef _ASM_S390_FPU_TYPES_H 9 + #define _ASM_S390_FPU_TYPES_H 10 + 11 + #include <asm/sigcontext.h> 12 + 13 + struct fpu { 14 + __u32 fpc; /* Floating-point control */ 15 + union { 16 + void *regs; 17 + freg_t *fprs; /* Floating-point register save area */ 18 + __vector128 *vxrs; /* Vector register save area */ 19 + }; 20 + }; 21 + 22 + /* VX array structure for address operand constraints in inline assemblies */ 23 + struct vx_array { __vector128 _[__NUM_VXRS]; }; 24 + 25 + #endif /* _ASM_S390_FPU_TYPES_H */
+1 -1
arch/s390/include/asm/kvm_host.h
··· 22 22 #include <linux/kvm.h> 23 23 #include <asm/debug.h> 24 24 #include <asm/cpu.h> 25 - #include <asm/fpu-internal.h> 25 + #include <asm/fpu/api.h> 26 26 #include <asm/isc.h> 27 27 28 28 #define KVM_MAX_VCPUS 64
+3 -2
arch/s390/include/asm/processor.h
··· 16 16 #define CIF_MCCK_PENDING 0 /* machine check handling is pending */ 17 17 #define CIF_ASCE 1 /* user asce needs fixup / uaccess */ 18 18 #define CIF_NOHZ_DELAY 2 /* delay HZ disable for a tick */ 19 - #define CIF_FPU 3 /* restore vector registers */ 19 + #define CIF_FPU 3 /* restore FPU registers */ 20 20 #define CIF_IGNORE_IRQ 4 /* ignore interrupt (for udelay) */ 21 21 22 22 #define _CIF_MCCK_PENDING _BITUL(CIF_MCCK_PENDING) ··· 34 34 #include <asm/ptrace.h> 35 35 #include <asm/setup.h> 36 36 #include <asm/runtime_instr.h> 37 - #include <asm/fpu-internal.h> 37 + #include <asm/fpu/types.h> 38 + #include <asm/fpu/internal.h> 38 39 39 40 static inline void set_cpu_flag(int flag) 40 41 {
+1 -1
arch/s390/include/asm/switch_to.h
··· 8 8 #define __ASM_SWITCH_TO_H 9 9 10 10 #include <linux/thread_info.h> 11 - #include <asm/fpu-internal.h> 11 + #include <asm/fpu/api.h> 12 12 #include <asm/ptrace.h> 13 13 14 14 extern struct task_struct *__switch_to(void *, void *);
-1
arch/s390/kernel/nmi.c
··· 21 21 #include <asm/nmi.h> 22 22 #include <asm/crw.h> 23 23 #include <asm/switch_to.h> 24 - #include <asm/fpu-internal.h> 25 24 #include <asm/ctl_reg.h> 26 25 27 26 struct mcck_struct {
+1 -1
arch/s390/kernel/s390_ksyms.c
··· 1 1 #include <linux/module.h> 2 2 #include <linux/kvm_host.h> 3 - #include <asm/fpu-internal.h> 3 + #include <asm/fpu/api.h> 4 4 #include <asm/ftrace.h> 5 5 6 6 #ifdef CONFIG_FUNCTION_TRACER
+1 -1
arch/s390/kernel/traps.c
··· 19 19 #include <linux/sched.h> 20 20 #include <linux/mm.h> 21 21 #include <linux/slab.h> 22 - #include <asm/fpu-internal.h> 22 + #include <asm/fpu/api.h> 23 23 #include "entry.h" 24 24 25 25 int show_unhandled_signals = 1;