1 /* Copyright (C) 2002-2015 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 #define FP_XSTATE_MAGIC1 0x46505853U
26 #define FP_XSTATE_MAGIC2 0x46505845U
27 #define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
32 __uint32_t extended_size
;
34 __uint32_t xstate_size
;
35 __uint32_t padding
[7];
40 unsigned short significand
[4];
41 unsigned short exponent
;
46 unsigned short significand
[4];
47 unsigned short exponent
;
48 unsigned short padding
[3];
53 __uint32_t element
[4];
62 /* Regular FPU environment. */
71 unsigned short status
;
74 /* FXSR FPU environment. */
75 __uint32_t _fxsr_env
[6];
78 struct _fpxreg _fxsr_st
[8];
79 struct _xmmreg _xmm
[8];
80 __uint32_t padding
[56];
83 #ifndef sigcontext_struct
84 /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
85 we need sigcontext. Some packages have come to rely on
86 sigcontext_struct being defined on 32-bit x86, so define this for
88 # define sigcontext_struct sigcontext
91 #define X86_FXSR_MAGIC 0x0000
95 unsigned short gs
, __gsh
;
96 unsigned short fs
, __fsh
;
97 unsigned short es
, __esh
;
98 unsigned short ds
, __dsh
;
107 unsigned long trapno
;
110 unsigned short cs
, __csh
;
111 unsigned long eflags
;
112 unsigned long esp_at_signal
;
113 unsigned short ss
, __ssh
;
114 struct _fpstate
* fpstate
;
115 unsigned long oldmask
;
119 #else /* __x86_64__ */
123 /* FPU environment matching the 64-bit FXSAVE layout. */
131 __uint32_t mxcr_mask
;
132 struct _fpxreg _st
[8];
133 struct _xmmreg _xmm
[16];
134 __uint32_t padding
[24];
160 unsigned short __pad0
;
167 struct _fpstate
* fpstate
;
168 __uint64_t __fpstate_word
;
170 __uint64_t __reserved1
[8];
173 #endif /* __x86_64__ */
177 __uint64_t xstate_bv
;
178 __uint64_t reserved1
[2];
179 __uint64_t reserved2
[5];
184 __uint32_t ymmh_space
[64];
189 struct _fpstate fpstate
;
190 struct _xsave_hdr xstate_hdr
;
191 struct _ymmh_state ymmh
;
194 #endif /* _BITS_SIGCONTEXT_H */