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
11void save_fpu_regs(void);
12
13static 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 */
31