blob: dc07c1f21ef8118c3ebc7d639676fc7921635596 [file] [log] [blame]
Elliott Hughese888de82013-11-19 15:32:31 -08001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#ifndef _SYS_USER_H_
30#define _SYS_USER_H_
31
32#include <sys/cdefs.h>
33
34__BEGIN_DECLS
35
36#if __i386__
37
38struct user_i387_struct {
39 long cwd;
40 long swd;
41 long twd;
42 long fip;
43 long fcs;
44 long foo;
45 long fos;
46 long st_space[20];
47};
48struct user_fxsr_struct {
49 unsigned short cwd;
50 unsigned short swd;
51 unsigned short twd;
52 unsigned short fop;
53 long fip;
54 long fcs;
55 long foo;
56 long fos;
57 long mxcsr;
58 long reserved;
59 long st_space[32];
60 long xmm_space[32];
61 long padding[56];
62};
63struct user_regs_struct {
64 unsigned long bx;
65 unsigned long cx;
66 unsigned long dx;
67 unsigned long si;
68 unsigned long di;
69 unsigned long bp;
70 unsigned long ax;
71 unsigned long ds;
72 unsigned long es;
73 unsigned long fs;
74 unsigned long gs;
75 unsigned long orig_ax;
76 unsigned long ip;
77 unsigned long cs;
78 unsigned long flags;
79 unsigned long sp;
80 unsigned long ss;
81};
82struct user{
83 struct user_regs_struct regs;
84 int u_fpvalid;
85 struct user_i387_struct i387;
86 unsigned long int u_tsize;
87 unsigned long int u_dsize;
88 unsigned long int u_ssize;
89 unsigned long start_code;
90 unsigned long start_stack;
91 long int signal;
92 int reserved;
93 unsigned long u_ar0;
94 struct user_i387_struct *u_fpstate;
95 unsigned long magic;
96 char u_comm[32];
97 int u_debugreg[8];
98};
99
100#elif defined(__x86_64__)
101
102struct user_i387_struct {
103 unsigned short cwd;
104 unsigned short swd;
105 unsigned short twd;
106 unsigned short fop;
107 __u64 rip;
108 __u64 rdp;
109 __u32 mxcsr;
110 __u32 mxcsr_mask;
111 __u32 st_space[32];
112 __u32 xmm_space[64];
113 __u32 padding[24];
114};
115struct user_regs_struct {
116 unsigned long r15;
117 unsigned long r14;
118 unsigned long r13;
119 unsigned long r12;
120 unsigned long bp;
121 unsigned long bx;
122 unsigned long r11;
123 unsigned long r10;
124 unsigned long r9;
125 unsigned long r8;
126 unsigned long ax;
127 unsigned long cx;
128 unsigned long dx;
129 unsigned long si;
130 unsigned long di;
131 unsigned long orig_ax;
132 unsigned long ip;
133 unsigned long cs;
134 unsigned long flags;
135 unsigned long sp;
136 unsigned long ss;
137 unsigned long fs_base;
138 unsigned long gs_base;
139 unsigned long ds;
140 unsigned long es;
141 unsigned long fs;
142 unsigned long gs;
143};
144struct user {
145 struct user_regs_struct regs;
146 int u_fpvalid;
147 int pad0;
148 struct user_i387_struct i387;
149 unsigned long int u_tsize;
150 unsigned long int u_dsize;
151 unsigned long int u_ssize;
152 unsigned long start_code;
153 unsigned long start_stack;
154 long int signal;
155 int reserved;
156 int pad1;
157 unsigned long u_ar0;
158 struct user_i387_struct *u_fpstate;
159 unsigned long magic;
160 char u_comm[32];
161 unsigned long u_debugreg[8];
162 unsigned long error_code;
163 unsigned long fault_address;
164};
165
166#elif defined(__mips__)
167
168struct user {
169 unsigned long regs[180 / sizeof(unsigned long) + 64];
170 size_t u_tsize;
171 size_t u_dsize;
172 size_t u_ssize;
173 unsigned long start_code;
174 unsigned long start_data;
175 unsigned long start_stack;
176 long int signal;
177 unsigned long u_ar0;
178 unsigned long magic;
179 char u_comm[32];
180};
181
182#else
183
184/* arm and aarch64 have uapi user.h headers. */
185#include <asm/user.h>
186
187#endif
188
189__END_DECLS
190
191#endif /* _SYS_USER_H_ */