]> git.proxmox.com Git - rustc.git/blame - src/liblibc/src/unix/notbsd/linux/other/b32/x86.rs
New upstream version 1.20.0+dfsg1
[rustc.git] / src / liblibc / src / unix / notbsd / linux / other / b32 / x86.rs
CommitLineData
92a42be0
SL
1pub type c_char = i8;
2pub type wchar_t = i32;
a7813a04 3pub type greg_t = i32;
9cc50fc6 4
54a0048b 5s! {
a7813a04
XL
6 pub struct _libc_fpreg {
7 pub significand: [u16; 4],
8 pub exponent: u16,
9 }
10
11 pub struct _libc_fpstate {
12 pub cw: ::c_ulong,
13 pub sw: ::c_ulong,
14 pub tag: ::c_ulong,
15 pub ipoff: ::c_ulong,
16 pub cssel: ::c_ulong,
17 pub dataoff: ::c_ulong,
18 pub datasel: ::c_ulong,
19 pub _st: [_libc_fpreg; 8],
20 pub status: ::c_ulong,
21 }
22
041b39d2
XL
23 pub struct user_fpregs_struct {
24 pub cwd: ::c_long,
25 pub swd: ::c_long,
26 pub twd: ::c_long,
27 pub fip: ::c_long,
28 pub fcs: ::c_long,
29 pub foo: ::c_long,
30 pub fos: ::c_long,
31 pub st_space: [::c_long; 20],
32 }
33
34 pub struct user_fpxregs_struct {
35 pub cwd: ::c_ushort,
36 pub swd: ::c_ushort,
37 pub twd: ::c_ushort,
38 pub fop: ::c_ushort,
39 pub fip: ::c_long,
40 pub fcs: ::c_long,
41 pub foo: ::c_long,
42 pub fos: ::c_long,
43 pub mxcsr: ::c_long,
44 __reserved: ::c_long,
45 pub st_space: [::c_long; 32],
46 pub xmm_space: [::c_long; 32],
47 padding: [::c_long; 56],
48 }
49
50 pub struct user_regs_struct {
51 pub ebx: ::c_long,
52 pub ecx: ::c_long,
53 pub edx: ::c_long,
54 pub esi: ::c_long,
55 pub edi: ::c_long,
56 pub ebp: ::c_long,
57 pub eax: ::c_long,
58 pub xds: ::c_long,
59 pub xes: ::c_long,
60 pub xfs: ::c_long,
61 pub xgs: ::c_long,
62 pub orig_eax: ::c_long,
63 pub eip: ::c_long,
64 pub xcs: ::c_long,
65 pub eflags: ::c_long,
66 pub esp: ::c_long,
67 pub xss: ::c_long,
68 }
69
70 pub struct user {
71 pub regs: user_regs_struct,
72 pub u_fpvalid: ::c_int,
73 pub i387: user_fpregs_struct,
74 pub u_tsize: ::c_ulong,
75 pub u_dsize: ::c_ulong,
76 pub u_ssize: ::c_ulong,
77 pub start_code: ::c_ulong,
78 pub start_stack: ::c_ulong,
79 pub signal: ::c_long,
80 __reserved: ::c_int,
81 pub u_ar0: *mut user_regs_struct,
82 pub u_fpstate: *mut user_fpregs_struct,
83 pub magic: ::c_ulong,
84 pub u_comm: [c_char; 32],
85 pub u_debugreg: [::c_int; 8],
86 }
87
54a0048b 88 pub struct mcontext_t {
a7813a04
XL
89 pub gregs: [greg_t; 19],
90 pub fpregs: *mut _libc_fpstate,
91 pub oldmask: ::c_ulong,
92 pub cr2: ::c_ulong,
54a0048b
SL
93 }
94
95 pub struct ucontext_t {
96 pub uc_flags: ::c_ulong,
97 pub uc_link: *mut ucontext_t,
98 pub uc_stack: ::stack_t,
99 pub uc_mcontext: mcontext_t,
100 pub uc_sigmask: ::sigset_t,
101 __private: [u8; 112],
102 }
9e0c209e
SL
103
104 pub struct ipc_perm {
105 pub __key: ::key_t,
106 pub uid: ::uid_t,
107 pub gid: ::gid_t,
108 pub cuid: ::uid_t,
109 pub cgid: ::gid_t,
110 pub mode: ::c_ushort,
111 __pad1: ::c_ushort,
112 pub __seq: ::c_ushort,
113 __pad2: ::c_ushort,
114 __unused1: ::c_ulong,
115 __unused2: ::c_ulong
116 }
117
118 pub struct stat64 {
119 pub st_dev: ::dev_t,
120 __pad1: ::c_uint,
121 __st_ino: ::ino_t,
122 pub st_mode: ::mode_t,
123 pub st_nlink: ::nlink_t,
124 pub st_uid: ::uid_t,
125 pub st_gid: ::gid_t,
126 pub st_rdev: ::dev_t,
127 __pad2: ::c_uint,
128 pub st_size: ::off64_t,
129 pub st_blksize: ::blksize_t,
130 pub st_blocks: ::blkcnt64_t,
131 pub st_atime: ::time_t,
132 pub st_atime_nsec: ::c_long,
133 pub st_mtime: ::time_t,
134 pub st_mtime_nsec: ::c_long,
135 pub st_ctime: ::time_t,
136 pub st_ctime_nsec: ::c_long,
137 pub st_ino: ::ino64_t,
138 }
139
140 pub struct shmid_ds {
141 pub shm_perm: ::ipc_perm,
142 pub shm_segsz: ::size_t,
143 pub shm_atime: ::time_t,
144 __unused1: ::c_ulong,
145 pub shm_dtime: ::time_t,
146 __unused2: ::c_ulong,
147 pub shm_ctime: ::time_t,
148 __unused3: ::c_ulong,
149 pub shm_cpid: ::pid_t,
150 pub shm_lpid: ::pid_t,
151 pub shm_nattch: ::shmatt_t,
152 __unused4: ::c_ulong,
153 __unused5: ::c_ulong
154 }
155
156 pub struct msqid_ds {
157 pub msg_perm: ::ipc_perm,
158 pub msg_stime: ::time_t,
159 __glibc_reserved1: ::c_ulong,
160 pub msg_rtime: ::time_t,
161 __glibc_reserved2: ::c_ulong,
162 pub msg_ctime: ::time_t,
163 __glibc_reserved3: ::c_ulong,
164 __msg_cbytes: ::c_ulong,
165 pub msg_qnum: ::msgqnum_t,
166 pub msg_qbytes: ::msglen_t,
167 pub msg_lspid: ::pid_t,
168 pub msg_lrpid: ::pid_t,
169 __glibc_reserved4: ::c_ulong,
170 __glibc_reserved5: ::c_ulong,
171 }
54a0048b
SL
172}
173
9cc50fc6
SL
174pub const O_DIRECT: ::c_int = 0x4000;
175pub const O_DIRECTORY: ::c_int = 0x10000;
176pub const O_NOFOLLOW: ::c_int = 0x20000;
177
178pub const MAP_LOCKED: ::c_int = 0x02000;
179pub const MAP_NORESERVE: ::c_int = 0x04000;
54a0048b 180pub const MAP_32BIT: ::c_int = 0x0040;
9cc50fc6
SL
181
182pub const EDEADLOCK: ::c_int = 35;
183
cc61c64b
XL
184pub const SO_SNDBUFFORCE: ::c_int = 32;
185pub const SO_RCVBUFFORCE: ::c_int = 33;
186pub const SO_NO_CHECK: ::c_int = 11;
187pub const SO_PRIORITY: ::c_int = 12;
188pub const SO_BSDCOMPAT: ::c_int = 14;
189pub const SO_PASSCRED: ::c_int = 16;
9cc50fc6
SL
190pub const SO_PEERCRED: ::c_int = 17;
191pub const SO_RCVLOWAT: ::c_int = 18;
192pub const SO_SNDLOWAT: ::c_int = 19;
193pub const SO_RCVTIMEO: ::c_int = 20;
194pub const SO_SNDTIMEO: ::c_int = 21;
195
196pub const FIOCLEX: ::c_ulong = 0x5451;
197pub const FIONBIO: ::c_ulong = 0x5421;
54a0048b
SL
198
199pub const SYS_gettid: ::c_long = 224;
200pub const SYS_perf_event_open: ::c_long = 336;
201
9e0c209e
SL
202pub const PTRACE_GETFPXREGS: ::c_uint = 18;
203pub const PTRACE_SETFPXREGS: ::c_uint = 19;
204
205pub const MCL_CURRENT: ::c_int = 0x0001;
206pub const MCL_FUTURE: ::c_int = 0x0002;
207
208pub const SIGSTKSZ: ::size_t = 8192;
7cac9316 209pub const MINSIGSTKSZ: ::size_t = 2048;
9e0c209e
SL
210pub const CBAUD: ::tcflag_t = 0o0010017;
211pub const TAB1: ::c_int = 0x00000800;
212pub const TAB2: ::c_int = 0x00001000;
213pub const TAB3: ::c_int = 0x00001800;
214pub const CR1: ::c_int = 0x00000200;
215pub const CR2: ::c_int = 0x00000400;
216pub const CR3: ::c_int = 0x00000600;
217pub const FF1: ::c_int = 0x00008000;
218pub const BS1: ::c_int = 0x00002000;
219pub const VT1: ::c_int = 0x00004000;
220pub const VWERASE: usize = 14;
221pub const VREPRINT: usize = 12;
222pub const VSUSP: usize = 10;
223pub const VSTART: usize = 8;
224pub const VSTOP: usize = 9;
225pub const VDISCARD: usize = 13;
226pub const VTIME: usize = 5;
227pub const IXON: ::tcflag_t = 0x00000400;
228pub const IXOFF: ::tcflag_t = 0x00001000;
229pub const ONLCR: ::tcflag_t = 0x4;
230pub const CSIZE: ::tcflag_t = 0x00000030;
231pub const CS6: ::tcflag_t = 0x00000010;
232pub const CS7: ::tcflag_t = 0x00000020;
233pub const CS8: ::tcflag_t = 0x00000030;
234pub const CSTOPB: ::tcflag_t = 0x00000040;
235pub const CREAD: ::tcflag_t = 0x00000080;
236pub const PARENB: ::tcflag_t = 0x00000100;
237pub const PARODD: ::tcflag_t = 0x00000200;
238pub const HUPCL: ::tcflag_t = 0x00000400;
239pub const CLOCAL: ::tcflag_t = 0x00000800;
240pub const ECHOKE: ::tcflag_t = 0x00000800;
241pub const ECHOE: ::tcflag_t = 0x00000010;
242pub const ECHOK: ::tcflag_t = 0x00000020;
243pub const ECHONL: ::tcflag_t = 0x00000040;
244pub const ECHOPRT: ::tcflag_t = 0x00000400;
245pub const ECHOCTL: ::tcflag_t = 0x00000200;
246pub const ISIG: ::tcflag_t = 0x00000001;
247pub const ICANON: ::tcflag_t = 0x00000002;
248pub const PENDIN: ::tcflag_t = 0x00004000;
249pub const NOFLSH: ::tcflag_t = 0x00000080;
250
cc61c64b
XL
251pub const B0: ::speed_t = 0o000000;
252pub const B50: ::speed_t = 0o000001;
253pub const B75: ::speed_t = 0o000002;
254pub const B110: ::speed_t = 0o000003;
255pub const B134: ::speed_t = 0o000004;
256pub const B150: ::speed_t = 0o000005;
257pub const B200: ::speed_t = 0o000006;
258pub const B300: ::speed_t = 0o000007;
259pub const B600: ::speed_t = 0o000010;
260pub const B1200: ::speed_t = 0o000011;
261pub const B1800: ::speed_t = 0o000012;
262pub const B2400: ::speed_t = 0o000013;
263pub const B4800: ::speed_t = 0o000014;
264pub const B9600: ::speed_t = 0o000015;
265pub const B19200: ::speed_t = 0o000016;
266pub const B38400: ::speed_t = 0o000017;
267pub const EXTA: ::speed_t = B19200;
268pub const EXTB: ::speed_t = B38400;
269pub const B57600: ::speed_t = 0o010001;
270pub const B115200: ::speed_t = 0o010002;
271pub const B230400: ::speed_t = 0o010003;
272pub const B460800: ::speed_t = 0o010004;
273pub const B500000: ::speed_t = 0o010005;
274pub const B576000: ::speed_t = 0o010006;
275pub const B921600: ::speed_t = 0o010007;
276pub const B1000000: ::speed_t = 0o010010;
277pub const B1152000: ::speed_t = 0o010011;
278pub const B1500000: ::speed_t = 0o010012;
279pub const B2000000: ::speed_t = 0o010013;
280pub const B2500000: ::speed_t = 0o010014;
281pub const B3000000: ::speed_t = 0o010015;
282pub const B3500000: ::speed_t = 0o010016;
283pub const B4000000: ::speed_t = 0o010017;
284
9e0c209e
SL
285pub const VEOL: usize = 11;
286pub const VEOL2: usize = 16;
287pub const VMIN: usize = 6;
288pub const IEXTEN: ::tcflag_t = 0x00008000;
289pub const TOSTOP: ::tcflag_t = 0x00000100;
290pub const FLUSHO: ::tcflag_t = 0x00001000;
291pub const EXTPROC: ::tcflag_t = 0x00010000;
292pub const TCGETS: ::c_ulong = 0x5401;
293pub const TCSETS: ::c_ulong = 0x5402;
294pub const TCSETSW: ::c_ulong = 0x5403;
295pub const TCSETSF: ::c_ulong = 0x5404;
296pub const TCGETA: ::c_ulong = 0x5405;
297pub const TCSETA: ::c_ulong = 0x5406;
298pub const TCSETAW: ::c_ulong = 0x5407;
299pub const TCSETAF: ::c_ulong = 0x5408;
300pub const TCSBRK: ::c_ulong = 0x5409;
301pub const TCXONC: ::c_ulong = 0x540A;
302pub const TCFLSH: ::c_ulong = 0x540B;
303pub const TIOCINQ: ::c_ulong = 0x541B;
304pub const TIOCGPGRP: ::c_ulong = 0x540F;
305pub const TIOCSPGRP: ::c_ulong = 0x5410;
306pub const TIOCOUTQ: ::c_ulong = 0x5411;
307pub const TIOCGWINSZ: ::c_ulong = 0x5413;
308pub const TIOCSWINSZ: ::c_ulong = 0x5414;
309pub const FIONREAD: ::c_ulong = 0x541B;
310
54a0048b
SL
311extern {
312 pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
313 pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
314 pub fn makecontext(ucp: *mut ucontext_t,
315 func: extern fn (),
316 argc: ::c_int, ...);
317 pub fn swapcontext(uocp: *mut ucontext_t,
318 ucp: *const ucontext_t) -> ::c_int;
319}