1 /* Copyright (C) 2002-2018 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
18 #ifndef _BITS_SIGCONTEXT_H
19 #define _BITS_SIGCONTEXT_H 1
21 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
22 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
25 #include <bits/types.h>
27 #define FP_XSTATE_MAGIC1 0x46505853U
28 #define FP_XSTATE_MAGIC2 0x46505845U
29 #define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
34 __uint32_t extended_size;
36 __uint32_t xstate_size;
37 __uint32_t __glibc_reserved1[7];
42 unsigned short significand[4];
43 unsigned short exponent;
48 unsigned short significand[4];
49 unsigned short exponent;
50 unsigned short __glibc_reserved1[3];
55 __uint32_t element[4];
64 /* Regular FPU environment. */
73 unsigned short status;
76 /* FXSR FPU environment. */
77 __uint32_t _fxsr_env[6];
79 __uint32_t __glibc_reserved1;
80 struct _fpxreg _fxsr_st[8];
81 struct _xmmreg _xmm[8];
82 __uint32_t __glibc_reserved2[56];
85 #ifndef sigcontext_struct
86 /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
87 we need sigcontext. Some packages have come to rely on
88 sigcontext_struct being defined on 32-bit x86, so define this for
90 # define sigcontext_struct sigcontext
93 #define X86_FXSR_MAGIC 0x0000
97 unsigned short gs, __gsh;
98 unsigned short fs, __fsh;
99 unsigned short es, __esh;
100 unsigned short ds, __dsh;
109 unsigned long trapno;
112 unsigned short cs, __csh;
113 unsigned long eflags;
114 unsigned long esp_at_signal;
115 unsigned short ss, __ssh;
116 struct _fpstate * fpstate;
117 unsigned long oldmask;
121 #else /* __x86_64__ */
125 /* FPU environment matching the 64-bit FXSAVE layout. */
133 __uint32_t mxcr_mask;
134 struct _fpxreg _st[8];
135 struct _xmmreg _xmm[16];
136 __uint32_t __glibc_reserved1[24];
162 unsigned short __pad0;
169 struct _fpstate * fpstate;
170 __uint64_t __fpstate_word;
172 __uint64_t __reserved1 [8];
175 #endif /* __x86_64__ */
179 __uint64_t xstate_bv;
180 __uint64_t __glibc_reserved1[2];
181 __uint64_t __glibc_reserved2[5];
186 __uint32_t ymmh_space[64];
191 struct _fpstate fpstate;
192 struct _xsave_hdr xstate_hdr;
193 struct _ymmh_state ymmh;
196 #endif /* _BITS_SIGCONTEXT_H */