Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0753902 authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by Martin Schwidefsky
Browse files

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" (78f7f1e5).

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: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 6933c35a
Loading
Loading
Loading
Loading
+30 −0
Original line number Original line Diff line number Diff line
/*
 * In-kernel FPU support functions
 *
 * Copyright IBM Corp. 2015
 * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
 */

#ifndef _ASM_S390_FPU_API_H
#define _ASM_S390_FPU_API_H

void save_fpu_regs(void);

static inline int test_fp_ctl(u32 fpc)
{
	u32 orig_fpc;
	int rc;

	asm volatile(
		"	efpc    %1\n"
		"	sfpc	%2\n"
		"0:	sfpc	%1\n"
		"	la	%0,0\n"
		"1:\n"
		EX_TABLE(0b,1b)
		: "=d" (rc), "=d" (orig_fpc)
		: "d" (fpc), "0" (-EINVAL));
	return rc;
}

#endif /* _ASM_S390_FPU_API_H */
+2 −35
Original line number Original line Diff line number Diff line
/*
/*
 * General floating pointer and vector register helpers
 * FPU state and register content conversion primitives
 *
 *
 * Copyright IBM Corp. 2015
 * Copyright IBM Corp. 2015
 * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
 * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
@@ -8,42 +8,9 @@
#ifndef _ASM_S390_FPU_INTERNAL_H
#ifndef _ASM_S390_FPU_INTERNAL_H
#define _ASM_S390_FPU_INTERNAL_H
#define _ASM_S390_FPU_INTERNAL_H


#include <linux/errno.h>
#include <linux/string.h>
#include <linux/string.h>
#include <asm/linkage.h>
#include <asm/ctl_reg.h>
#include <asm/ctl_reg.h>
#include <asm/sigcontext.h>
#include <asm/fpu/types.h>

struct fpu {
	__u32 fpc;			/* Floating-point control */
	union {
		void *regs;
		freg_t *fprs;		/* Floating-point register save area */
		__vector128 *vxrs;	/* Vector register save area */
	};
};

void save_fpu_regs(void);

/* VX array structure for address operand constraints in inline assemblies */
struct vx_array { __vector128 _[__NUM_VXRS]; };

static inline int test_fp_ctl(u32 fpc)
{
	u32 orig_fpc;
	int rc;

	asm volatile(
		"	efpc    %1\n"
		"	sfpc	%2\n"
		"0:	sfpc	%1\n"
		"	la	%0,0\n"
		"1:\n"
		EX_TABLE(0b,1b)
		: "=d" (rc), "=d" (orig_fpc)
		: "d" (fpc), "0" (-EINVAL));
	return rc;
}


static inline void save_vx_regs_safe(__vector128 *vxrs)
static inline void save_vx_regs_safe(__vector128 *vxrs)
{
{
+25 −0
Original line number Original line Diff line number Diff line
/*
 * FPU data structures
 *
 * Copyright IBM Corp. 2015
 * Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
 */

#ifndef _ASM_S390_FPU_TYPES_H
#define _ASM_S390_FPU_TYPES_H

#include <asm/sigcontext.h>

struct fpu {
	__u32 fpc;			/* Floating-point control */
	union {
		void *regs;
		freg_t *fprs;		/* Floating-point register save area */
		__vector128 *vxrs;	/* Vector register save area */
	};
};

/* VX array structure for address operand constraints in inline assemblies */
struct vx_array { __vector128 _[__NUM_VXRS]; };

#endif /* _ASM_S390_FPU_TYPES_H */
+1 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@
#include <linux/kvm.h>
#include <linux/kvm.h>
#include <asm/debug.h>
#include <asm/debug.h>
#include <asm/cpu.h>
#include <asm/cpu.h>
#include <asm/fpu-internal.h>
#include <asm/fpu/api.h>
#include <asm/isc.h>
#include <asm/isc.h>


#define KVM_MAX_VCPUS 64
#define KVM_MAX_VCPUS 64
+3 −2
Original line number Original line Diff line number Diff line
@@ -16,7 +16,7 @@
#define CIF_MCCK_PENDING	0	/* machine check handling is pending */
#define CIF_MCCK_PENDING	0	/* machine check handling is pending */
#define CIF_ASCE		1	/* user asce needs fixup / uaccess */
#define CIF_ASCE		1	/* user asce needs fixup / uaccess */
#define CIF_NOHZ_DELAY		2	/* delay HZ disable for a tick */
#define CIF_NOHZ_DELAY		2	/* delay HZ disable for a tick */
#define CIF_FPU			3	/* restore vector registers */
#define CIF_FPU			3	/* restore FPU registers */
#define CIF_IGNORE_IRQ		4	/* ignore interrupt (for udelay) */
#define CIF_IGNORE_IRQ		4	/* ignore interrupt (for udelay) */


#define _CIF_MCCK_PENDING	_BITUL(CIF_MCCK_PENDING)
#define _CIF_MCCK_PENDING	_BITUL(CIF_MCCK_PENDING)
@@ -34,7 +34,8 @@
#include <asm/ptrace.h>
#include <asm/ptrace.h>
#include <asm/setup.h>
#include <asm/setup.h>
#include <asm/runtime_instr.h>
#include <asm/runtime_instr.h>
#include <asm/fpu-internal.h>
#include <asm/fpu/types.h>
#include <asm/fpu/internal.h>


static inline void set_cpu_flag(int flag)
static inline void set_cpu_flag(int flag)
{
{
Loading