xref: /linux/arch/x86/include/asm/sigcontext.h (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 #ifndef _ASM_X86_SIGCONTEXT_H
2 #define _ASM_X86_SIGCONTEXT_H
3 
4 #include <uapi/asm/sigcontext.h>
5 
6 #ifdef __i386__
7 struct sigcontext {
8 	unsigned short gs, __gsh;
9 	unsigned short fs, __fsh;
10 	unsigned short es, __esh;
11 	unsigned short ds, __dsh;
12 	unsigned long di;
13 	unsigned long si;
14 	unsigned long bp;
15 	unsigned long sp;
16 	unsigned long bx;
17 	unsigned long dx;
18 	unsigned long cx;
19 	unsigned long ax;
20 	unsigned long trapno;
21 	unsigned long err;
22 	unsigned long ip;
23 	unsigned short cs, __csh;
24 	unsigned long flags;
25 	unsigned long sp_at_signal;
26 	unsigned short ss, __ssh;
27 
28 	/*
29 	 * fpstate is really (struct _fpstate *) or (struct _xstate *)
30 	 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
31 	 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
32 	 * of extended memory layout. See comments at the definition of
33 	 * (struct _fpx_sw_bytes)
34 	 */
35 	void __user *fpstate;		/* zero when no FPU/extended context */
36 	unsigned long oldmask;
37 	unsigned long cr2;
38 };
39 #else /* __i386__ */
40 struct sigcontext {
41 	unsigned long r8;
42 	unsigned long r9;
43 	unsigned long r10;
44 	unsigned long r11;
45 	unsigned long r12;
46 	unsigned long r13;
47 	unsigned long r14;
48 	unsigned long r15;
49 	unsigned long di;
50 	unsigned long si;
51 	unsigned long bp;
52 	unsigned long bx;
53 	unsigned long dx;
54 	unsigned long ax;
55 	unsigned long cx;
56 	unsigned long sp;
57 	unsigned long ip;
58 	unsigned long flags;
59 	unsigned short cs;
60 	unsigned short gs;
61 	unsigned short fs;
62 	unsigned short __pad0;
63 	unsigned long err;
64 	unsigned long trapno;
65 	unsigned long oldmask;
66 	unsigned long cr2;
67 
68 	/*
69 	 * fpstate is really (struct _fpstate *) or (struct _xstate *)
70 	 * depending on the FP_XSTATE_MAGIC1 encoded in the SW reserved
71 	 * bytes of (struct _fpstate) and FP_XSTATE_MAGIC2 present at the end
72 	 * of extended memory layout. See comments at the definition of
73 	 * (struct _fpx_sw_bytes)
74 	 */
75 	void __user *fpstate;		/* zero when no FPU/extended context */
76 	unsigned long reserved1[8];
77 };
78 #endif /* !__i386__ */
79 #endif /* _ASM_X86_SIGCONTEXT_H */
80