wok-next view coreutils/stuff/sigcontext.h @ rev 17559
slim: why force base theme on update
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Thu Feb 05 21:41:45 2015 -0500 (2015-02-05) |
parents | |
children |
line source
1 #ifndef _ASM_X86_SIGCONTEXT_H
2 #define _ASM_X86_SIGCONTEXT_H
4 #include <asm/types.h>
6 #ifdef __i386__
7 /*
8 * As documented in the iBCS2 standard..
9 *
10 * The first part of "struct _fpstate" is just the normal i387
11 * hardware setup, the extra "status" word is used to save the
12 * coprocessor status word before entering the handler.
13 *
14 * Pentium III FXSR, SSE support
15 * Gareth Hughes <gareth@valinux.com>, May 2000
16 *
17 * The FPU state data structure has had to grow to accommodate the
18 * extended FPU state required by the Streaming SIMD Extensions.
19 * There is no documented standard to accomplish this at the moment.
20 */
21 struct _fpreg {
22 unsigned short significand[4];
23 unsigned short exponent;
24 };
26 struct _fpxreg {
27 unsigned short significand[4];
28 unsigned short exponent;
29 unsigned short padding[3];
30 };
32 struct _xmmreg {
33 unsigned long element[4];
34 };
36 struct _fpstate {
37 /* Regular FPU environment */
38 unsigned long cw;
39 unsigned long sw;
40 unsigned long tag;
41 unsigned long ipoff;
42 unsigned long cssel;
43 unsigned long dataoff;
44 unsigned long datasel;
45 struct _fpreg _st[8];
46 unsigned short status;
47 unsigned short magic; /* 0xffff = regular FPU data only */
49 /* FXSR FPU environment */
50 unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
51 unsigned long mxcsr;
52 unsigned long reserved;
53 struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
54 struct _xmmreg _xmm[8];
55 unsigned long padding[56];
56 };
58 #define X86_FXSR_MAGIC 0x0000
60 /*
61 * User-space might still rely on the old definition:
62 */
63 struct sigcontext {
64 unsigned short gs, __gsh;
65 unsigned short fs, __fsh;
66 unsigned short es, __esh;
67 unsigned short ds, __dsh;
68 unsigned long edi;
69 unsigned long esi;
70 unsigned long ebp;
71 unsigned long esp;
72 unsigned long ebx;
73 unsigned long edx;
74 unsigned long ecx;
75 unsigned long eax;
76 unsigned long trapno;
77 unsigned long err;
78 unsigned long eip;
79 unsigned short cs, __csh;
80 unsigned long eflags;
81 unsigned long esp_at_signal;
82 unsigned short ss, __ssh;
83 struct _fpstate * fpstate;
84 unsigned long oldmask;
85 unsigned long cr2;
86 };
88 #else /* __i386__ */
90 /* FXSAVE frame */
91 /* Note: reserved1/2 may someday contain valuable data. Always save/restore
92 them when you change signal frames. */
93 struct _fpstate {
94 __u16 cwd;
95 __u16 swd;
96 __u16 twd; /* Note this is not the same as the 32bit/x87/FSAVE twd */
97 __u16 fop;
98 __u64 rip;
99 __u64 rdp;
100 __u32 mxcsr;
101 __u32 mxcsr_mask;
102 __u32 st_space[32]; /* 8*16 bytes for each FP-reg */
103 __u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg */
104 __u32 reserved2[24];
105 };
107 /*
108 * User-space might still rely on the old definition:
109 */
110 struct sigcontext {
111 unsigned long r8;
112 unsigned long r9;
113 unsigned long r10;
114 unsigned long r11;
115 unsigned long r12;
116 unsigned long r13;
117 unsigned long r14;
118 unsigned long r15;
119 unsigned long rdi;
120 unsigned long rsi;
121 unsigned long rbp;
122 unsigned long rbx;
123 unsigned long rdx;
124 unsigned long rax;
125 unsigned long rcx;
126 unsigned long rsp;
127 unsigned long rip;
128 unsigned long eflags; /* RFLAGS */
129 unsigned short cs;
130 unsigned short gs;
131 unsigned short fs;
132 unsigned short __pad0;
133 unsigned long err;
134 unsigned long trapno;
135 unsigned long oldmask;
136 unsigned long cr2;
137 struct _fpstate *fpstate; /* zero when no FPU context */
138 unsigned long reserved1[8];
139 };
141 #endif /* !__i386__ */
143 #endif