modernc.org/cc@v1.0.1/v2/headers/linux_amd64/usr/include/bits/sigcontext.h (about) 1 /* Copyright (C) 2002-2015 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 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. 8 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. 13 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/>. */ 17 18 #ifndef _BITS_SIGCONTEXT_H 19 #define _BITS_SIGCONTEXT_H 1 20 21 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H 22 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." 23 #endif 24 25 #define FP_XSTATE_MAGIC1 0x46505853U 26 #define FP_XSTATE_MAGIC2 0x46505845U 27 #define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2) 28 29 struct _fpx_sw_bytes { 30 __uint32_t magic1; 31 __uint32_t extended_size; 32 __uint64_t xstate_bv; 33 __uint32_t xstate_size; 34 __uint32_t padding[7]; 35 }; 36 37 struct _fpreg { 38 unsigned short significand[4]; 39 unsigned short exponent; 40 }; 41 42 struct _fpxreg { 43 unsigned short significand[4]; 44 unsigned short exponent; 45 unsigned short padding[3]; 46 }; 47 48 struct _xmmreg { 49 __uint32_t element[4]; 50 }; 51 52 #ifndef __x86_64__ 53 54 struct _fpstate { 55 /* Regular FPU environment. */ 56 __uint32_t cw; 57 __uint32_t sw; 58 __uint32_t tag; 59 __uint32_t ipoff; 60 __uint32_t cssel; 61 __uint32_t dataoff; 62 __uint32_t datasel; 63 struct _fpreg _st[8]; 64 unsigned short status; 65 unsigned short magic; 66 67 /* FXSR FPU environment. */ 68 __uint32_t _fxsr_env[6]; 69 __uint32_t mxcsr; 70 __uint32_t reserved; 71 struct _fpxreg _fxsr_st[8]; 72 struct _xmmreg _xmm[8]; 73 __uint32_t padding[56]; 74 }; 75 76 #ifndef sigcontext_struct 77 /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but 78 we need sigcontext. Some packages have come to rely on 79 sigcontext_struct being defined on 32-bit x86, so define this for 80 their benefit. */ 81 # define sigcontext_struct sigcontext 82 #endif 83 84 #define X86_FXSR_MAGIC 0x0000 85 86 struct sigcontext { 87 unsigned short gs, __gsh; 88 unsigned short fs, __fsh; 89 unsigned short es, __esh; 90 unsigned short ds, __dsh; 91 unsigned long edi; 92 unsigned long esi; 93 unsigned long ebp; 94 unsigned long esp; 95 unsigned long ebx; 96 unsigned long edx; 97 unsigned long ecx; 98 unsigned long eax; 99 unsigned long trapno; 100 unsigned long err; 101 unsigned long eip; 102 unsigned short cs, __csh; 103 unsigned long eflags; 104 unsigned long esp_at_signal; 105 unsigned short ss, __ssh; 106 struct _fpstate *fpstate; 107 unsigned long oldmask; 108 unsigned long cr2; 109 }; 110 111 #else /* __x86_64__ */ 112 113 struct _fpstate { 114 /* FPU environment matching the 64-bit FXSAVE layout. */ 115 __uint16_t cwd; 116 __uint16_t swd; 117 __uint16_t ftw; 118 __uint16_t fop; 119 __uint64_t rip; 120 __uint64_t rdp; 121 __uint32_t mxcsr; 122 __uint32_t mxcr_mask; 123 struct _fpxreg _st[8]; 124 struct _xmmreg _xmm[16]; 125 __uint32_t padding[24]; 126 }; 127 128 struct sigcontext { 129 __uint64_t r8; 130 __uint64_t r9; 131 __uint64_t r10; 132 __uint64_t r11; 133 __uint64_t r12; 134 __uint64_t r13; 135 __uint64_t r14; 136 __uint64_t r15; 137 __uint64_t rdi; 138 __uint64_t rsi; 139 __uint64_t rbp; 140 __uint64_t rbx; 141 __uint64_t rdx; 142 __uint64_t rax; 143 __uint64_t rcx; 144 __uint64_t rsp; 145 __uint64_t rip; 146 __uint64_t eflags; 147 unsigned short cs; 148 unsigned short gs; 149 unsigned short fs; 150 unsigned short __pad0; 151 __uint64_t err; 152 __uint64_t trapno; 153 __uint64_t oldmask; 154 __uint64_t cr2; 155 __extension__ union { 156 struct _fpstate *fpstate; 157 __uint64_t __fpstate_word; 158 }; 159 __uint64_t __reserved1[8]; 160 }; 161 162 #endif /* __x86_64__ */ 163 164 struct _xsave_hdr { 165 __uint64_t xstate_bv; 166 __uint64_t reserved1[2]; 167 __uint64_t reserved2[5]; 168 }; 169 170 struct _ymmh_state { 171 __uint32_t ymmh_space[64]; 172 }; 173 174 struct _xstate { 175 struct _fpstate fpstate; 176 struct _xsave_hdr xstate_hdr; 177 struct _ymmh_state ymmh; 178 }; 179 180 #endif /* _BITS_SIGCONTEXT_H */