1 /* Linux-specific definitions: */
3 /* Define various structure offsets to simplify cross-compilation. */
5 /* Offsets for x86 Linux "ucontext_t": */
7 #define LINUX_UC_FLAGS_OFF 0x00
8 #define LINUX_UC_LINK_OFF 0x04
9 #define LINUX_UC_STACK_OFF 0x08
10 #define LINUX_UC_MCONTEXT_OFF 0x14
11 #define LINUX_UC_SIGMASK_OFF 0x6c
12 #define LINUX_UC_FPREGS_MEM_OFF 0xec
14 /* The struct sigcontext is located at an offset of 4
15 from the stack pointer in the signal frame. */
17 /* Offsets for x86 Linux "struct sigcontext": */
19 #define LINUX_SC_GS_OFF 0x00
20 #define LINUX_SC_GSH_OFF 0x02
21 #define LINUX_SC_FS_OFF 0x04
22 #define LINUX_SC_FSH_OFF 0x06
23 #define LINUX_SC_ES_OFF 0x08
24 #define LINUX_SC_ESH_OFF 0x0a
25 #define LINUX_SC_DS_OFF 0x0c
26 #define LINUX_SC_DSH_OFF 0x0e
27 #define LINUX_SC_EDI_OFF 0x10
28 #define LINUX_SC_ESI_OFF 0x14
29 #define LINUX_SC_EBP_OFF 0x18
30 #define LINUX_SC_ESP_OFF 0x1c
31 #define LINUX_SC_EBX_OFF 0x20
32 #define LINUX_SC_EDX_OFF 0x24
33 #define LINUX_SC_ECX_OFF 0x28
34 #define LINUX_SC_EAX_OFF 0x2c
35 #define LINUX_SC_TRAPNO_OFF 0x30
36 #define LINUX_SC_ERR_OFF 0x34
37 #define LINUX_SC_EIP_OFF 0x38
38 #define LINUX_SC_CS_OFF 0x3c
39 #define LINUX_SC_CSH_OFF 0x3e
40 #define LINUX_SC_EFLAGS_OFF 0x40
41 #define LINUX_SC_ESP_AT_SIGNAL_OFF 0x44
42 #define LINUX_SC_SS_OFF 0x48
43 #define LINUX_SC_SSH_OFF 0x4a
44 #define LINUX_SC_FPSTATE_OFF 0x4c
45 #define LINUX_SC_OLDMASK_OFF 0x50
46 #define LINUX_SC_CR2_OFF 0x54
48 /* Offsets for x86 Linux "struct _fpstate": */
50 #define LINUX_FPSTATE_CW_OFF 0x000
51 #define LINUX_FPSTATE_SW_OFF 0x004
52 #define LINUX_FPSTATE_TAG_OFF 0x008
53 #define LINUX_FPSTATE_IPOFF_OFF 0x00c
54 #define LINUX_FPSTATE_CSSEL_OFF 0x010
55 #define LINUX_FPSTATE_DATAOFF_OFF 0x014
56 #define LINUX_FPSTATE_DATASEL_OFF 0x018
57 #define LINUX_FPSTATE_ST0_OFF 0x01c
58 #define LINUX_FPSTATE_ST1_OFF 0x026
59 #define LINUX_FPSTATE_ST2_OFF 0x030
60 #define LINUX_FPSTATE_ST3_OFF 0x03a
61 #define LINUX_FPSTATE_ST4_OFF 0x044
62 #define LINUX_FPSTATE_ST5_OFF 0x04e
63 #define LINUX_FPSTATE_ST6_OFF 0x058
64 #define LINUX_FPSTATE_ST7_OFF 0x062
65 #define LINUX_FPSTATE_STATUS_OFF 0x06c
66 #define LINUX_FPSTATE_MAGIC_OFF 0x06e
67 #define LINUX_FPSTATE_FXSR_ENV_OFF 0x070
68 #define LINUX_FPSTATE_MXCSR_OFF 0x088
69 #define LINUX_FPSTATE_FXSR_ST0_OFF 0x090
70 #define LINUX_FPSTATE_FXSR_ST1_OFF 0x0a0
71 #define LINUX_FPSTATE_FXSR_ST2_OFF 0x0b0
72 #define LINUX_FPSTATE_FXSR_ST3_OFF 0x0c0
73 #define LINUX_FPSTATE_FXSR_ST4_OFF 0x0d0
74 #define LINUX_FPSTATE_FXSR_ST5_OFF 0x0e0
75 #define LINUX_FPSTATE_FXSR_ST6_OFF 0x0f0
76 #define LINUX_FPSTATE_FXSR_ST7_OFF 0x100
77 #define LINUX_FPSTATE_XMM0_OFF 0x110
78 #define LINUX_FPSTATE_XMM1_OFF 0x120
79 #define LINUX_FPSTATE_XMM2_OFF 0x130
80 #define LINUX_FPSTATE_XMM3_OFF 0x140
81 #define LINUX_FPSTATE_XMM4_OFF 0x150
82 #define LINUX_FPSTATE_XMM5_OFF 0x160
83 #define LINUX_FPSTATE_XMM6_OFF 0x170
84 #define LINUX_FPSTATE_XMM7_OFF 0x180
86 /* FreeBSD-specific definitions: */
88 #define FREEBSD_SC_UCONTEXT_OFF 0x20
89 #define FREEBSD_UC_MCONTEXT_OFF 0x10
91 #define FREEBSD_UC_MCONTEXT_GS_OFF 0x14
92 #define FREEBSD_UC_MCONTEXT_FS_OFF 0x18
93 #define FREEBSD_UC_MCONTEXT_ES_OFF 0x1c
94 #define FREEBSD_UC_MCONTEXT_DS_OFF 0x20
95 #define FREEBSD_UC_MCONTEXT_EDI_OFF 0x24
96 #define FREEBSD_UC_MCONTEXT_ESI_OFF 0x28
97 #define FREEBSD_UC_MCONTEXT_EBP_OFF 0x2c
98 #define FREEBSD_UC_MCONTEXT_EBX_OFF 0x34
99 #define FREEBSD_UC_MCONTEXT_EDX_OFF 0x38
100 #define FREEBSD_UC_MCONTEXT_ECX_OFF 0x3c
101 #define FREEBSD_UC_MCONTEXT_EAX_OFF 0x40
102 #define FREEBSD_UC_MCONTEXT_TRAPNO_OFF 0x44
103 #define FREEBSD_UC_MCONTEXT_EIP_OFF 0x4c
104 #define FREEBSD_UC_MCONTEXT_ESP_OFF 0x58
105 #define FREEBSD_UC_MCONTEXT_CS_OFF 0x50
106 #define FREEBSD_UC_MCONTEXT_EFLAGS_OFF 0x54
107 #define FREEBSD_UC_MCONTEXT_SS_OFF 0x5c
108 #define FREEBSD_UC_MCONTEXT_MC_LEN_OFF 0x60
109 #define FREEBSD_UC_MCONTEXT_FPFORMAT_OFF 0x64
110 #define FREEBSD_UC_MCONTEXT_OWNEDFP_OFF 0x68
111 #define FREEBSD_UC_MCONTEXT_FPSTATE_OFF 0x70
113 #define FREEBSD_UC_MCONTEXT_CW_OFF 0x70
114 #define FREEBSD_UC_MCONTEXT_SW_OFF 0x74
115 #define FREEBSD_UC_MCONTEXT_TAG_OFF 0x78
116 #define FREEBSD_UC_MCONTEXT_IPOFF_OFF 0x7c
117 #define FREEBSD_UC_MCONTEXT_CSSEL_OFF 0x80
118 #define FREEBSD_UC_MCONTEXT_DATAOFF_OFF 0x84
119 #define FREEBSD_US_MCONTEXT_DATASEL_OFF 0x88
120 #define FREEBSD_UC_MCONTEXT_ST0_OFF 0x8c
122 #define FREEBSD_UC_MCONTEXT_CW_XMM_OFF 0x70
123 #define FREEBSD_UC_MCONTEXT_SW_XMM_OFF 0x72
124 #define FREEBSD_UC_MCONTEXT_TAG_XMM_OFF 0x74
125 #define FREEBSD_UC_MCONTEXT_IPOFF_XMM_OFF 0x78
126 #define FREEBSD_UC_MCONTEXT_CSSEL_XMM_OFF 0x7c
127 #define FREEBSD_UC_MCONTEXT_DATAOFF_XMM_OFF 0x80
128 #define FREEBSD_US_MCONTEXT_DATASEL_XMM_OFF 0x84
129 #define FREEBSD_UC_MCONTEXT_MXCSR_XMM_OFF 0x88
130 #define FREEBSD_UC_MCONTEXT_ST0_XMM_OFF 0x90
131 #define FREEBSD_UC_MCONTEXT_XMM0_OFF 0x110
133 #define FREEBSD_UC_MCONTEXT_MC_LEN_VAL 0x280
134 #define FREEBSD_UC_MCONTEXT_FPFMT_NODEV 0x10000
135 #define FREEBSD_UC_MCONTEXT_FPFMT_387 0x10001
136 #define FREEBSD_UC_MCONTEXT_FPFMT_XMM 0x10002
137 #define FREEBSD_UC_MCONTEXT_FPOWNED_NONE 0x20000
138 #define FREEBSD_UC_MCONTEXT_FPOWNED_FPU 0x20001
139 #define FREEBSD_UC_MCONTEXT_FPOWNED_PCB 0x20002