blob: 9e2fe9ced084b8f2968d208cb53cfdfb86cba91e [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Russell King4baa9922008-08-02 10:55:55 +01003 * arch/arm/include/asm/fpstate.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
5 * Copyright (C) 1995 Russell King
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 */
7
8#ifndef __ASM_ARM_FPSTATE_H
9#define __ASM_ARM_FPSTATE_H
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12#ifndef __ASSEMBLY__
13
14/*
15 * VFP storage area has:
16 * - FPEXC, FPSCR, FPINST and FPINST2.
Catalin Marinas25ebee02007-09-25 15:22:24 +010017 * - 16 or 32 double precision data registers
Lucas De Marchi25985ed2011-03-30 22:57:33 -030018 * - an implementation-dependent word of state for FLDMX/FSTMX (pre-ARMv6)
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 *
20 * FPEXC will always be non-zero once the VFP has been used in this process.
21 */
22
23struct vfp_hard_struct {
Catalin Marinas25ebee02007-09-25 15:22:24 +010024#ifdef CONFIG_VFPv3
25 __u64 fpregs[32];
26#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 __u64 fpregs[16];
Catalin Marinas25ebee02007-09-25 15:22:24 +010028#endif
Catalin Marinasbb54a332006-04-10 21:32:42 +010029#if __LINUX_ARM_ARCH__ < 6
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 __u32 fpmx_state;
Catalin Marinasbb54a332006-04-10 21:32:42 +010031#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 __u32 fpexc;
33 __u32 fpscr;
34 /*
35 * VFP implementation specific state
36 */
37 __u32 fpinst;
38 __u32 fpinst2;
Catalin Marinas25ebee02007-09-25 15:22:24 +010039
Catalin Marinasc6428462007-01-24 18:47:08 +010040#ifdef CONFIG_SMP
41 __u32 cpu;
42#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070043};
44
45union vfp_state {
46 struct vfp_hard_struct hard;
47};
48
49extern void vfp_flush_thread(union vfp_state *);
50extern void vfp_release_thread(union vfp_state *);
51
52#define FP_HARD_SIZE 35
53
54struct fp_hard_struct {
55 unsigned int save[FP_HARD_SIZE]; /* as yet undefined */
56};
57
58#define FP_SOFT_SIZE 35
59
60struct fp_soft_struct {
61 unsigned int save[FP_SOFT_SIZE]; /* undefined information */
62};
63
Russell Kingcdaabbd2006-03-12 22:36:06 +000064#define IWMMXT_SIZE 0x98
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066struct iwmmxt_struct {
Russell Kingcdaabbd2006-03-12 22:36:06 +000067 unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
Linus Torvalds1da177e2005-04-16 15:20:36 -070068};
69
70union fp_state {
71 struct fp_hard_struct hard;
72 struct fp_soft_struct soft;
73#ifdef CONFIG_IWMMXT
74 struct iwmmxt_struct iwmmxt;
75#endif
76};
77
78#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
79
Lennert Buytenhekc17fad12006-06-27 23:03:03 +010080struct crunch_state {
81 unsigned int mvdx[16][2];
82 unsigned int mvax[4][3];
83 unsigned int dspsc[2];
84};
85
86#define CRUNCH_SIZE sizeof(struct crunch_state)
87
Linus Torvalds1da177e2005-04-16 15:20:36 -070088#endif
89
90#endif