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