Back to index

glibc  2.9
sigcontext.h
Go to the documentation of this file.
00001 /* Copyright (C) 2002 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _BITS_SIGCONTEXT_H
00020 #define _BITS_SIGCONTEXT_H  1
00021 
00022 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
00023 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
00024 #endif
00025 
00026 #include <bits/wordsize.h>
00027 
00028 struct _fpreg
00029 {
00030   unsigned short significand[4];
00031   unsigned short exponent;
00032 };
00033 
00034 struct _fpxreg
00035 {
00036   unsigned short significand[4];
00037   unsigned short exponent;
00038   unsigned short padding[3];
00039 };
00040 
00041 struct _xmmreg
00042 {
00043   __uint32_t  element[4];
00044 };
00045 
00046 
00047 
00048 #if __WORDSIZE == 32
00049 
00050 struct _fpstate
00051 {
00052   /* Regular FPU environment.  */
00053   __uint32_t  cw;
00054   __uint32_t         sw;
00055   __uint32_t         tag;
00056   __uint32_t         ipoff;
00057   __uint32_t         cssel;
00058   __uint32_t         dataoff;
00059   __uint32_t         datasel;
00060   struct _fpreg      _st[8];
00061   unsigned short status;
00062   unsigned short magic;
00063 
00064   /* FXSR FPU environment.  */
00065   __uint32_t         _fxsr_env[6];
00066   __uint32_t         mxcsr;
00067   __uint32_t         reserved;
00068   struct _fpxreg     _fxsr_st[8];
00069   struct _xmmreg     _xmm[8];
00070   __uint32_t         padding[56];
00071 };
00072 
00073 #ifndef sigcontext_struct
00074 /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
00075    we need sigcontext.  Some packages have come to rely on
00076    sigcontext_struct being defined on 32-bit x86, so define this for
00077    their benefit.  */
00078 # define sigcontext_struct sigcontext
00079 #endif
00080 
00081 struct sigcontext
00082 {
00083   unsigned short gs, __gsh;
00084   unsigned short fs, __fsh;
00085   unsigned short es, __esh;
00086   unsigned short ds, __dsh;
00087   unsigned long edi;
00088   unsigned long esi;
00089   unsigned long ebp;
00090   unsigned long esp;
00091   unsigned long ebx;
00092   unsigned long edx;
00093   unsigned long ecx;
00094   unsigned long eax;
00095   unsigned long trapno;
00096   unsigned long err;
00097   unsigned long eip;
00098   unsigned short cs, __csh;
00099   unsigned long eflags;
00100   unsigned long esp_at_signal;
00101   unsigned short ss, __ssh;
00102   struct _fpstate * fpstate;
00103   unsigned long oldmask;
00104   unsigned long cr2;
00105 };
00106 
00107 #else /* __WORDSIZE == 64 */
00108 
00109 struct _fpstate
00110 {
00111   /* FPU environment matching the 64-bit FXSAVE layout.  */
00112   __uint16_t         cwd;
00113   __uint16_t         swd;
00114   __uint16_t         ftw;
00115   __uint16_t         fop;
00116   __uint64_t         rip;
00117   __uint64_t         rdp;
00118   __uint32_t         mxcsr;
00119   __uint32_t         mxcr_mask;
00120   struct _fpxreg     _st[8];
00121   struct _xmmreg     _xmm[16];
00122   __uint32_t         padding[24];
00123 };
00124 
00125 struct sigcontext
00126 {
00127   unsigned long r8;
00128   unsigned long r9;
00129   unsigned long r10;
00130   unsigned long r11;
00131   unsigned long r12;
00132   unsigned long r13;
00133   unsigned long r14;
00134   unsigned long r15;
00135   unsigned long rdi;
00136   unsigned long rsi;
00137   unsigned long rbp;
00138   unsigned long rbx;
00139   unsigned long rdx;
00140   unsigned long rax;
00141   unsigned long rcx;
00142   unsigned long rsp;
00143   unsigned long rip;
00144   unsigned long eflags;
00145   unsigned short cs;
00146   unsigned short gs;
00147   unsigned short fs;
00148   unsigned short __pad0;
00149   unsigned long err;
00150   unsigned long trapno;
00151   unsigned long oldmask;
00152   unsigned long cr2;
00153   struct _fpstate * fpstate;
00154   unsigned long __reserved1 [8];
00155 };
00156 
00157 #endif /* __WORDSIZE == 64 */
00158 
00159 #endif /* _BITS_SIGCONTEXT_H */