2.9
[glibc/nacl-glibc.git] / sysdeps / unix / sysv / linux / x86_64 / sys / user.h
blobceadcf47881ba0c1c04087a9b3e5f786d4b3a8bf
1 /* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #ifndef _SYS_USER_H
20 #define _SYS_USER_H 1
22 /* The whole purpose of this file is for GDB and GDB only. Don't read
23 too much into it. Don't use it for anything other than GDB unless
24 you know what you are doing. */
26 #include <bits/wordsize.h>
28 #if __WORDSIZE == 64
30 struct user_fpregs_struct
32 __uint16_t cwd;
33 __uint16_t swd;
34 __uint16_t ftw;
35 __uint16_t fop;
36 __uint64_t rip;
37 __uint64_t rdp;
38 __uint32_t mxcsr;
39 __uint32_t mxcr_mask;
40 __uint32_t st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
41 __uint32_t xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
42 __uint32_t padding[24];
45 struct user_regs_struct
47 unsigned long r15;
48 unsigned long r14;
49 unsigned long r13;
50 unsigned long r12;
51 unsigned long rbp;
52 unsigned long rbx;
53 unsigned long r11;
54 unsigned long r10;
55 unsigned long r9;
56 unsigned long r8;
57 unsigned long rax;
58 unsigned long rcx;
59 unsigned long rdx;
60 unsigned long rsi;
61 unsigned long rdi;
62 unsigned long orig_rax;
63 unsigned long rip;
64 unsigned long cs;
65 unsigned long eflags;
66 unsigned long rsp;
67 unsigned long ss;
68 unsigned long fs_base;
69 unsigned long gs_base;
70 unsigned long ds;
71 unsigned long es;
72 unsigned long fs;
73 unsigned long gs;
76 struct user
78 struct user_regs_struct regs;
79 int u_fpvalid;
80 struct user_fpregs_struct i387;
81 unsigned long int u_tsize;
82 unsigned long int u_dsize;
83 unsigned long int u_ssize;
84 unsigned long start_code;
85 unsigned long start_stack;
86 long int signal;
87 int reserved;
88 struct user_regs_struct* u_ar0;
89 struct user_fpregs_struct* u_fpstate;
90 unsigned long int magic;
91 char u_comm [32];
92 unsigned long int u_debugreg [8];
95 #else
96 /* These are the 32-bit x86 structures. */
97 struct user_fpregs_struct
99 long int cwd;
100 long int swd;
101 long int twd;
102 long int fip;
103 long int fcs;
104 long int foo;
105 long int fos;
106 long int st_space [20];
109 struct user_fpxregs_struct
111 unsigned short int cwd;
112 unsigned short int swd;
113 unsigned short int twd;
114 unsigned short int fop;
115 long int fip;
116 long int fcs;
117 long int foo;
118 long int fos;
119 long int mxcsr;
120 long int reserved;
121 long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
122 long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
123 long int padding[56];
126 struct user_regs_struct
128 long int ebx;
129 long int ecx;
130 long int edx;
131 long int esi;
132 long int edi;
133 long int ebp;
134 long int eax;
135 long int xds;
136 long int xes;
137 long int xfs;
138 long int xgs;
139 long int orig_eax;
140 long int eip;
141 long int xcs;
142 long int eflags;
143 long int esp;
144 long int xss;
147 struct user
149 struct user_regs_struct regs;
150 int u_fpvalid;
151 struct user_fpregs_struct i387;
152 unsigned long int u_tsize;
153 unsigned long int u_dsize;
154 unsigned long int u_ssize;
155 unsigned long start_code;
156 unsigned long start_stack;
157 long int signal;
158 int reserved;
159 struct user_regs_struct* u_ar0;
160 struct user_fpregs_struct* u_fpstate;
161 unsigned long int magic;
162 char u_comm [32];
163 int u_debugreg [8];
165 #endif /* __WORDSIZE */
167 #define PAGE_SHIFT 12
168 #define PAGE_SIZE (1UL << PAGE_SHIFT)
169 #define PAGE_MASK (~(PAGE_SIZE-1))
170 #define NBPG PAGE_SIZE
171 #define UPAGES 1
172 #define HOST_TEXT_START_ADDR (u.start_code)
173 #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
175 #endif /* _SYS_USER_H */