modernc.org/cc@v1.0.1/v2/headers/linux_386/usr/include/i386-linux-gnu/bits/sigcontext.h (about)

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