OSDN Git Service

Replace FSF snail mail address with URLs
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / x86_64 / bits / sigcontext.h
1 /* Copyright (C) 2002 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/wordsize.h>
26
27 struct _fpreg
28 {
29   unsigned short significand[4];
30   unsigned short exponent;
31 };
32
33 struct _fpxreg
34 {
35   unsigned short significand[4];
36   unsigned short exponent;
37   unsigned short padding[3];
38 };
39
40 struct _xmmreg
41 {
42   __uint32_t    element[4];
43 };
44
45
46
47 #if __WORDSIZE == 32
48
49 struct _fpstate
50 {
51   /* Regular FPU environment.  */
52   __uint32_t    cw;
53   __uint32_t            sw;
54   __uint32_t            tag;
55   __uint32_t            ipoff;
56   __uint32_t            cssel;
57   __uint32_t            dataoff;
58   __uint32_t            datasel;
59   struct _fpreg _st[8];
60   unsigned short status;
61   unsigned short magic;
62
63   /* FXSR FPU environment.  */
64   __uint32_t            _fxsr_env[6];
65   __uint32_t            mxcsr;
66   __uint32_t            reserved;
67   struct _fpxreg        _fxsr_st[8];
68   struct _xmmreg        _xmm[8];
69   __uint32_t            padding[56];
70 };
71
72 #ifndef sigcontext_struct
73 /* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
74    we need sigcontext.  Some packages have come to rely on
75    sigcontext_struct being defined on 32-bit x86, so define this for
76    their benefit.  */
77 # define sigcontext_struct sigcontext
78 #endif
79
80 struct sigcontext
81 {
82   unsigned short gs, __gsh;
83   unsigned short fs, __fsh;
84   unsigned short es, __esh;
85   unsigned short ds, __dsh;
86   unsigned long edi;
87   unsigned long esi;
88   unsigned long ebp;
89   unsigned long esp;
90   unsigned long ebx;
91   unsigned long edx;
92   unsigned long ecx;
93   unsigned long eax;
94   unsigned long trapno;
95   unsigned long err;
96   unsigned long eip;
97   unsigned short cs, __csh;
98   unsigned long eflags;
99   unsigned long esp_at_signal;
100   unsigned short ss, __ssh;
101   struct _fpstate * fpstate;
102   unsigned long oldmask;
103   unsigned long cr2;
104 };
105
106 #else /* __WORDSIZE == 64 */
107
108 struct _fpstate
109 {
110   /* FPU environment matching the 64-bit FXSAVE layout.  */
111   __uint16_t            cwd;
112   __uint16_t            swd;
113   __uint16_t            ftw;
114   __uint16_t            fop;
115   __uint64_t            rip;
116   __uint64_t            rdp;
117   __uint32_t            mxcsr;
118   __uint32_t            mxcr_mask;
119   struct _fpxreg        _st[8];
120   struct _xmmreg        _xmm[16];
121   __uint32_t            padding[24];
122 };
123
124 struct sigcontext
125 {
126   unsigned long r8;
127   unsigned long r9;
128   unsigned long r10;
129   unsigned long r11;
130   unsigned long r12;
131   unsigned long r13;
132   unsigned long r14;
133   unsigned long r15;
134   unsigned long rdi;
135   unsigned long rsi;
136   unsigned long rbp;
137   unsigned long rbx;
138   unsigned long rdx;
139   unsigned long rax;
140   unsigned long rcx;
141   unsigned long rsp;
142   unsigned long rip;
143   unsigned long eflags;
144   unsigned short cs;
145   unsigned short gs;
146   unsigned short fs;
147   unsigned short __pad0;
148   unsigned long err;
149   unsigned long trapno;
150   unsigned long oldmask;
151   unsigned long cr2;
152   struct _fpstate * fpstate;
153   unsigned long __reserved1 [8];
154 };
155
156 #endif /* __WORDSIZE == 64 */
157
158 #endif /* _BITS_SIGCONTEXT_H */