18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  arch/arm/include/asm/fpstate.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 1995 Russell King
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __ASM_ARM_FPSTATE_H
98c2ecf20Sopenharmony_ci#define __ASM_ARM_FPSTATE_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/*
158c2ecf20Sopenharmony_ci * VFP storage area has:
168c2ecf20Sopenharmony_ci *  - FPEXC, FPSCR, FPINST and FPINST2.
178c2ecf20Sopenharmony_ci *  - 16 or 32 double precision data registers
188c2ecf20Sopenharmony_ci *  - an implementation-dependent word of state for FLDMX/FSTMX (pre-ARMv6)
198c2ecf20Sopenharmony_ci *
208c2ecf20Sopenharmony_ci *  FPEXC will always be non-zero once the VFP has been used in this process.
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_cistruct vfp_hard_struct {
248c2ecf20Sopenharmony_ci#ifdef CONFIG_VFPv3
258c2ecf20Sopenharmony_ci	__u64 fpregs[32];
268c2ecf20Sopenharmony_ci#else
278c2ecf20Sopenharmony_ci	__u64 fpregs[16];
288c2ecf20Sopenharmony_ci#endif
298c2ecf20Sopenharmony_ci#if __LINUX_ARM_ARCH__ < 6
308c2ecf20Sopenharmony_ci	__u32 fpmx_state;
318c2ecf20Sopenharmony_ci#endif
328c2ecf20Sopenharmony_ci	__u32 fpexc;
338c2ecf20Sopenharmony_ci	__u32 fpscr;
348c2ecf20Sopenharmony_ci	/*
358c2ecf20Sopenharmony_ci	 * VFP implementation specific state
368c2ecf20Sopenharmony_ci	 */
378c2ecf20Sopenharmony_ci	__u32 fpinst;
388c2ecf20Sopenharmony_ci	__u32 fpinst2;
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#ifdef CONFIG_SMP
418c2ecf20Sopenharmony_ci	__u32 cpu;
428c2ecf20Sopenharmony_ci#endif
438c2ecf20Sopenharmony_ci};
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciunion vfp_state {
468c2ecf20Sopenharmony_ci	struct vfp_hard_struct	hard;
478c2ecf20Sopenharmony_ci};
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciextern void vfp_flush_thread(union vfp_state *);
508c2ecf20Sopenharmony_ciextern void vfp_release_thread(union vfp_state *);
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define FP_HARD_SIZE 35
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_cistruct fp_hard_struct {
558c2ecf20Sopenharmony_ci	unsigned int save[FP_HARD_SIZE];		/* as yet undefined */
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#define FP_SOFT_SIZE 35
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_cistruct fp_soft_struct {
618c2ecf20Sopenharmony_ci	unsigned int save[FP_SOFT_SIZE];		/* undefined information */
628c2ecf20Sopenharmony_ci};
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define IWMMXT_SIZE	0x98
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_cistruct iwmmxt_struct {
678c2ecf20Sopenharmony_ci	unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
688c2ecf20Sopenharmony_ci};
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ciunion fp_state {
718c2ecf20Sopenharmony_ci	struct fp_hard_struct	hard;
728c2ecf20Sopenharmony_ci	struct fp_soft_struct	soft;
738c2ecf20Sopenharmony_ci#ifdef CONFIG_IWMMXT
748c2ecf20Sopenharmony_ci	struct iwmmxt_struct	iwmmxt;
758c2ecf20Sopenharmony_ci#endif
768c2ecf20Sopenharmony_ci};
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_cistruct crunch_state {
818c2ecf20Sopenharmony_ci	unsigned int	mvdx[16][2];
828c2ecf20Sopenharmony_ci	unsigned int	mvax[4][3];
838c2ecf20Sopenharmony_ci	unsigned int	dspsc[2];
848c2ecf20Sopenharmony_ci};
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define CRUNCH_SIZE	sizeof(struct crunch_state)
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#endif
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#endif
91