xref: /OK3568_Linux_fs/kernel/arch/ia64/include/asm/fpswa.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef _ASM_IA64_FPSWA_H
3*4882a593Smuzhiyun #define _ASM_IA64_FPSWA_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun /*
6*4882a593Smuzhiyun  * Floating-point Software Assist
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Copyright (C) 1999 Intel Corporation.
9*4882a593Smuzhiyun  * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
10*4882a593Smuzhiyun  * Copyright (C) 1999 Goutham Rao <goutham.rao@intel.com>
11*4882a593Smuzhiyun  */
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun typedef struct {
14*4882a593Smuzhiyun 	/* 4 * 128 bits */
15*4882a593Smuzhiyun 	unsigned long fp_lp[4*2];
16*4882a593Smuzhiyun } fp_state_low_preserved_t;
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun typedef struct {
19*4882a593Smuzhiyun 	/* 10 * 128 bits */
20*4882a593Smuzhiyun 	unsigned long fp_lv[10 * 2];
21*4882a593Smuzhiyun } fp_state_low_volatile_t;
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun typedef	struct {
24*4882a593Smuzhiyun 	/* 16 * 128 bits */
25*4882a593Smuzhiyun 	unsigned long fp_hp[16 * 2];
26*4882a593Smuzhiyun } fp_state_high_preserved_t;
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun typedef struct {
29*4882a593Smuzhiyun 	/* 96 * 128 bits */
30*4882a593Smuzhiyun 	unsigned long fp_hv[96 * 2];
31*4882a593Smuzhiyun } fp_state_high_volatile_t;
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun /**
34*4882a593Smuzhiyun  * floating point state to be passed to the FP emulation library by
35*4882a593Smuzhiyun  * the trap/fault handler
36*4882a593Smuzhiyun  */
37*4882a593Smuzhiyun typedef struct {
38*4882a593Smuzhiyun 	unsigned long			bitmask_low64;
39*4882a593Smuzhiyun 	unsigned long			bitmask_high64;
40*4882a593Smuzhiyun 	fp_state_low_preserved_t	*fp_state_low_preserved;
41*4882a593Smuzhiyun 	fp_state_low_volatile_t		*fp_state_low_volatile;
42*4882a593Smuzhiyun 	fp_state_high_preserved_t	*fp_state_high_preserved;
43*4882a593Smuzhiyun 	fp_state_high_volatile_t	*fp_state_high_volatile;
44*4882a593Smuzhiyun } fp_state_t;
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun typedef struct {
47*4882a593Smuzhiyun 	unsigned long status;
48*4882a593Smuzhiyun 	unsigned long err0;
49*4882a593Smuzhiyun 	unsigned long err1;
50*4882a593Smuzhiyun 	unsigned long err2;
51*4882a593Smuzhiyun } fpswa_ret_t;
52*4882a593Smuzhiyun 
53*4882a593Smuzhiyun /**
54*4882a593Smuzhiyun  * function header for the Floating Point software assist
55*4882a593Smuzhiyun  * library. This function is invoked by the Floating point software
56*4882a593Smuzhiyun  * assist trap/fault handler.
57*4882a593Smuzhiyun  */
58*4882a593Smuzhiyun typedef fpswa_ret_t (*efi_fpswa_t) (unsigned long trap_type, void *bundle, unsigned long *ipsr,
59*4882a593Smuzhiyun 				    unsigned long *fsr, unsigned long *isr, unsigned long *preds,
60*4882a593Smuzhiyun 				    unsigned long *ifs, fp_state_t *fp_state);
61*4882a593Smuzhiyun 
62*4882a593Smuzhiyun /**
63*4882a593Smuzhiyun  * This is the FPSWA library interface as defined by EFI.  We need to pass a
64*4882a593Smuzhiyun  * pointer to the interface itself on a call to the assist library
65*4882a593Smuzhiyun  */
66*4882a593Smuzhiyun typedef struct {
67*4882a593Smuzhiyun 	unsigned int	 revision;
68*4882a593Smuzhiyun 	unsigned int	 reserved;
69*4882a593Smuzhiyun 	efi_fpswa_t	 fpswa;
70*4882a593Smuzhiyun } fpswa_interface_t;
71*4882a593Smuzhiyun 
72*4882a593Smuzhiyun extern fpswa_interface_t *fpswa_interface;
73*4882a593Smuzhiyun 
74*4882a593Smuzhiyun #endif /* _ASM_IA64_FPSWA_H */
75