]>
Commit | Line | Data |
---|---|---|
b168057a | 1 | /* Copyright (C) 2001-2015 Free Software Foundation, Inc. |
c9cf6dde AJ |
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 | |
59ba27a6 PE |
15 | License along with the GNU C Library; if not, see |
16 | <http://www.gnu.org/licenses/>. */ | |
c9cf6dde AJ |
17 | |
18 | #ifndef _SYS_USER_H | |
19 | #define _SYS_USER_H 1 | |
20 | ||
21 | /* The whole purpose of this file is for GDB and GDB only. Don't read | |
22 | too much into it. Don't use it for anything other than GDB unless | |
23 | you know what you are doing. */ | |
24 | ||
f62ee380 | 25 | #ifdef __x86_64__ |
cb50c218 | 26 | |
c9cf6dde AJ |
27 | struct user_fpregs_struct |
28 | { | |
d79a9c94 UD |
29 | unsigned short int cwd; |
30 | unsigned short int swd; | |
31 | unsigned short int ftw; | |
32 | unsigned short int fop; | |
f62ee380 L |
33 | __extension__ unsigned long long int rip; |
34 | __extension__ unsigned long long int rdp; | |
d79a9c94 UD |
35 | unsigned int mxcsr; |
36 | unsigned int mxcr_mask; | |
37 | unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ | |
38 | unsigned int xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ | |
39 | unsigned int padding[24]; | |
c9cf6dde AJ |
40 | }; |
41 | ||
42 | struct user_regs_struct | |
43 | { | |
f62ee380 L |
44 | __extension__ unsigned long long int r15; |
45 | __extension__ unsigned long long int r14; | |
46 | __extension__ unsigned long long int r13; | |
47 | __extension__ unsigned long long int r12; | |
48 | __extension__ unsigned long long int rbp; | |
49 | __extension__ unsigned long long int rbx; | |
50 | __extension__ unsigned long long int r11; | |
51 | __extension__ unsigned long long int r10; | |
52 | __extension__ unsigned long long int r9; | |
53 | __extension__ unsigned long long int r8; | |
54 | __extension__ unsigned long long int rax; | |
55 | __extension__ unsigned long long int rcx; | |
56 | __extension__ unsigned long long int rdx; | |
57 | __extension__ unsigned long long int rsi; | |
58 | __extension__ unsigned long long int rdi; | |
59 | __extension__ unsigned long long int orig_rax; | |
60 | __extension__ unsigned long long int rip; | |
61 | __extension__ unsigned long long int cs; | |
62 | __extension__ unsigned long long int eflags; | |
63 | __extension__ unsigned long long int rsp; | |
64 | __extension__ unsigned long long int ss; | |
65 | __extension__ unsigned long long int fs_base; | |
66 | __extension__ unsigned long long int gs_base; | |
67 | __extension__ unsigned long long int ds; | |
68 | __extension__ unsigned long long int es; | |
69 | __extension__ unsigned long long int fs; | |
70 | __extension__ unsigned long long int gs; | |
cb50c218 AJ |
71 | }; |
72 | ||
73 | struct user | |
74 | { | |
75 | struct user_regs_struct regs; | |
76 | int u_fpvalid; | |
77 | struct user_fpregs_struct i387; | |
f62ee380 L |
78 | __extension__ unsigned long long int u_tsize; |
79 | __extension__ unsigned long long int u_dsize; | |
80 | __extension__ unsigned long long int u_ssize; | |
81 | __extension__ unsigned long long int start_code; | |
82 | __extension__ unsigned long long int start_stack; | |
83 | __extension__ long long int signal; | |
cb50c218 | 84 | int reserved; |
3707636e L |
85 | __extension__ union |
86 | { | |
87 | struct user_regs_struct* u_ar0; | |
88 | __extension__ unsigned long long int __u_ar0_word; | |
89 | }; | |
90 | __extension__ union | |
91 | { | |
92 | struct user_fpregs_struct* u_fpstate; | |
93 | __extension__ unsigned long long int __u_fpstate_word; | |
94 | }; | |
f62ee380 | 95 | __extension__ unsigned long long int magic; |
cb50c218 | 96 | char u_comm [32]; |
f62ee380 | 97 | __extension__ unsigned long long int u_debugreg [8]; |
cb50c218 AJ |
98 | }; |
99 | ||
100 | #else | |
101 | /* These are the 32-bit x86 structures. */ | |
102 | struct user_fpregs_struct | |
103 | { | |
104 | long int cwd; | |
105 | long int swd; | |
106 | long int twd; | |
107 | long int fip; | |
108 | long int fcs; | |
109 | long int foo; | |
110 | long int fos; | |
111 | long int st_space [20]; | |
112 | }; | |
113 | ||
114 | struct user_fpxregs_struct | |
115 | { | |
116 | unsigned short int cwd; | |
117 | unsigned short int swd; | |
118 | unsigned short int twd; | |
119 | unsigned short int fop; | |
120 | long int fip; | |
121 | long int fcs; | |
122 | long int foo; | |
123 | long int fos; | |
124 | long int mxcsr; | |
125 | long int reserved; | |
126 | long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ | |
127 | long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ | |
128 | long int padding[56]; | |
129 | }; | |
130 | ||
131 | struct user_regs_struct | |
132 | { | |
133 | long int ebx; | |
134 | long int ecx; | |
135 | long int edx; | |
136 | long int esi; | |
137 | long int edi; | |
138 | long int ebp; | |
139 | long int eax; | |
140 | long int xds; | |
141 | long int xes; | |
142 | long int xfs; | |
143 | long int xgs; | |
144 | long int orig_eax; | |
145 | long int eip; | |
146 | long int xcs; | |
147 | long int eflags; | |
148 | long int esp; | |
149 | long int xss; | |
c9cf6dde AJ |
150 | }; |
151 | ||
152 | struct user | |
153 | { | |
154 | struct user_regs_struct regs; | |
155 | int u_fpvalid; | |
156 | struct user_fpregs_struct i387; | |
157 | unsigned long int u_tsize; | |
158 | unsigned long int u_dsize; | |
159 | unsigned long int u_ssize; | |
d79a9c94 UD |
160 | unsigned long int start_code; |
161 | unsigned long int start_stack; | |
c9cf6dde AJ |
162 | long int signal; |
163 | int reserved; | |
164 | struct user_regs_struct* u_ar0; | |
165 | struct user_fpregs_struct* u_fpstate; | |
166 | unsigned long int magic; | |
167 | char u_comm [32]; | |
168 | int u_debugreg [8]; | |
169 | }; | |
f62ee380 | 170 | #endif /* __x86_64__ */ |
c9cf6dde AJ |
171 | |
172 | #define PAGE_SHIFT 12 | |
173 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | |
174 | #define PAGE_MASK (~(PAGE_SIZE-1)) | |
175 | #define NBPG PAGE_SIZE | |
176 | #define UPAGES 1 | |
177 | #define HOST_TEXT_START_ADDR (u.start_code) | |
178 | #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) | |
179 | ||
180 | #endif /* _SYS_USER_H */ |