blob: fa18f7840db98800cc82f190cd2733d7944916db [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Elliott Hughesabd62612013-11-08 11:45:48 -08007#ifndef _UAPI_ASM_X86_SIGCONTEXT_H
8#define _UAPI_ASM_X86_SIGCONTEXT_H
9#include <linux/compiler.h>
10#include <linux/types.h>
Elliott Hughesabd62612013-11-08 11:45:48 -080011#define FP_XSTATE_MAGIC1 0x46505853U
12#define FP_XSTATE_MAGIC2 0x46505845U
13#define FP_XSTATE_MAGIC2_SIZE sizeof(FP_XSTATE_MAGIC2)
14struct _fpx_sw_bytes {
Tao Baod7db5942015-01-28 10:07:51 -080015 __u32 magic1;
16 __u32 extended_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080017 __u64 xfeatures;
Tao Baod7db5942015-01-28 10:07:51 -080018 __u32 xstate_size;
Tao Baod7db5942015-01-28 10:07:51 -080019 __u32 padding[7];
Elliott Hughesabd62612013-11-08 11:45:48 -080020};
Elliott Hughesabd62612013-11-08 11:45:48 -080021struct _fpreg {
Christopher Ferris05d08e92016-02-04 13:16:38 -080022 __u16 significand[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -080023 __u16 exponent;
Elliott Hughesabd62612013-11-08 11:45:48 -080024};
25struct _fpxreg {
Christopher Ferris05d08e92016-02-04 13:16:38 -080026 __u16 significand[4];
Christopher Ferris05d08e92016-02-04 13:16:38 -080027 __u16 exponent;
28 __u16 padding[3];
Elliott Hughesabd62612013-11-08 11:45:48 -080029};
Elliott Hughesabd62612013-11-08 11:45:48 -080030struct _xmmreg {
Christopher Ferris05d08e92016-02-04 13:16:38 -080031 __u32 element[4];
Elliott Hughesabd62612013-11-08 11:45:48 -080032};
33#define X86_FXSR_MAGIC 0x0000
Christopher Ferris05d08e92016-02-04 13:16:38 -080034struct _fpstate_32 {
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 __u32 cw;
36 __u32 sw;
37 __u32 tag;
38 __u32 ipoff;
Christopher Ferris05d08e92016-02-04 13:16:38 -080039 __u32 cssel;
40 __u32 dataoff;
41 __u32 datasel;
42 struct _fpreg _st[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 __u16 status;
44 __u16 magic;
45 __u32 _fxsr_env[6];
46 __u32 mxcsr;
Christopher Ferris05d08e92016-02-04 13:16:38 -080047 __u32 reserved;
48 struct _fpxreg _fxsr_st[8];
49 struct _xmmreg _xmm[8];
50 union {
Christopher Ferris05d08e92016-02-04 13:16:38 -080051 __u32 padding1[44];
52 __u32 padding[44];
53 };
54 union {
Christopher Ferris05d08e92016-02-04 13:16:38 -080055 __u32 padding2[12];
56 struct _fpx_sw_bytes sw_reserved;
57 };
Elliott Hughesabd62612013-11-08 11:45:48 -080058};
Christopher Ferris05d08e92016-02-04 13:16:38 -080059struct _fpstate_64 {
Tao Baod7db5942015-01-28 10:07:51 -080060 __u16 cwd;
61 __u16 swd;
62 __u16 twd;
Christopher Ferris05d08e92016-02-04 13:16:38 -080063 __u16 fop;
Tao Baod7db5942015-01-28 10:07:51 -080064 __u64 rip;
65 __u64 rdp;
66 __u32 mxcsr;
Christopher Ferris05d08e92016-02-04 13:16:38 -080067 __u32 mxcsr_mask;
Tao Baod7db5942015-01-28 10:07:51 -080068 __u32 st_space[32];
69 __u32 xmm_space[64];
70 __u32 reserved2[12];
Christopher Ferris05d08e92016-02-04 13:16:38 -080071 union {
Tao Baod7db5942015-01-28 10:07:51 -080072 __u32 reserved3[12];
73 struct _fpx_sw_bytes sw_reserved;
74 };
Elliott Hughesabd62612013-11-08 11:45:48 -080075};
Christopher Ferris05d08e92016-02-04 13:16:38 -080076#ifdef __i386__
77#define _fpstate _fpstate_32
78#else
Christopher Ferris05d08e92016-02-04 13:16:38 -080079#define _fpstate _fpstate_64
Elliott Hughesabd62612013-11-08 11:45:48 -080080#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -080081struct _header {
82 __u64 xfeatures;
Tao Baod7db5942015-01-28 10:07:51 -080083 __u64 reserved1[2];
84 __u64 reserved2[5];
Elliott Hughesabd62612013-11-08 11:45:48 -080085};
86struct _ymmh_state {
Tao Baod7db5942015-01-28 10:07:51 -080087 __u32 ymmh_space[64];
Elliott Hughesabd62612013-11-08 11:45:48 -080088};
89struct _xstate {
Tao Baod7db5942015-01-28 10:07:51 -080090 struct _fpstate fpstate;
Christopher Ferris05d08e92016-02-04 13:16:38 -080091 struct _header xstate_hdr;
Tao Baod7db5942015-01-28 10:07:51 -080092 struct _ymmh_state ymmh;
Elliott Hughesabd62612013-11-08 11:45:48 -080093};
Christopher Ferris05d08e92016-02-04 13:16:38 -080094struct sigcontext_32 {
Christopher Ferris05d08e92016-02-04 13:16:38 -080095 __u16 gs, __gsh;
96 __u16 fs, __fsh;
97 __u16 es, __esh;
98 __u16 ds, __dsh;
Christopher Ferris05d08e92016-02-04 13:16:38 -080099 __u32 di;
100 __u32 si;
101 __u32 bp;
102 __u32 sp;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103 __u32 bx;
104 __u32 dx;
105 __u32 cx;
106 __u32 ax;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 __u32 trapno;
108 __u32 err;
109 __u32 ip;
110 __u16 cs, __csh;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 __u32 flags;
112 __u32 sp_at_signal;
113 __u16 ss, __ssh;
114 __u32 fpstate;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800115 __u32 oldmask;
116 __u32 cr2;
117};
118struct sigcontext_64 {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119 __u64 r8;
120 __u64 r9;
121 __u64 r10;
122 __u64 r11;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123 __u64 r12;
124 __u64 r13;
125 __u64 r14;
126 __u64 r15;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800127 __u64 di;
128 __u64 si;
129 __u64 bp;
130 __u64 bx;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800131 __u64 dx;
132 __u64 ax;
133 __u64 cx;
134 __u64 sp;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800135 __u64 ip;
136 __u64 flags;
137 __u16 cs;
138 __u16 gs;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800139 __u16 fs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700140 __u16 ss;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800141 __u64 err;
142 __u64 trapno;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800143 __u64 oldmask;
144 __u64 cr2;
145 __u64 fpstate;
146 __u64 reserved1[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800147};
148#define _fpstate_ia32 _fpstate_32
149#define sigcontext_ia32 sigcontext_32
150#ifdef __i386__
Christopher Ferris05d08e92016-02-04 13:16:38 -0800151struct sigcontext {
152 __u16 gs, __gsh;
153 __u16 fs, __fsh;
154 __u16 es, __esh;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800155 __u16 ds, __dsh;
156 __u32 edi;
157 __u32 esi;
158 __u32 ebp;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800159 __u32 esp;
160 __u32 ebx;
161 __u32 edx;
162 __u32 ecx;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163 __u32 eax;
164 __u32 trapno;
165 __u32 err;
166 __u32 eip;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800167 __u16 cs, __csh;
168 __u32 eflags;
169 __u32 esp_at_signal;
170 __u16 ss, __ssh;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -0700171 struct _fpstate * fpstate;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800172 __u32 oldmask;
173 __u32 cr2;
174};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800175#else
176struct sigcontext {
177 __u64 r8;
178 __u64 r9;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800179 __u64 r10;
180 __u64 r11;
181 __u64 r12;
182 __u64 r13;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800183 __u64 r14;
184 __u64 r15;
185 __u64 rdi;
186 __u64 rsi;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800187 __u64 rbp;
188 __u64 rbx;
189 __u64 rdx;
190 __u64 rax;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800191 __u64 rcx;
192 __u64 rsp;
193 __u64 rip;
194 __u64 eflags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800195 __u16 cs;
196 __u16 gs;
197 __u16 fs;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700198 union {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700199 __u16 ss;
200 __u16 __pad0;
201 };
Christopher Ferris05d08e92016-02-04 13:16:38 -0800202 __u64 err;
203 __u64 trapno;
204 __u64 oldmask;
205 __u64 cr2;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -0700206 struct _fpstate * fpstate;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800207#ifdef __ILP32__
208 __u32 __fpstate_pad;
209#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -0800210 __u64 reserved1[8];
211};
212#endif
Elliott Hughesabd62612013-11-08 11:45:48 -0800213#endif