Debian Codegraph @

third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/x86.rs

raw
1 use crate::prelude::*;
2
3 pub type clock_t = c_ulong;
4 pub type wchar_t = i32;
5 pub type time_t = i32;
6 pub type suseconds_t = i32;
7 pub type register_t = i32;
8
9 s_no_extra_traits! {
10 #[repr(align(16))]
11 pub struct mcontext_t {
12 pub mc_onstack: register_t,
13 pub mc_gs: register_t,
14 pub mc_fs: register_t,
15 pub mc_es: register_t,
16 pub mc_ds: register_t,
17 pub mc_edi: register_t,
18 pub mc_esi: register_t,
19 pub mc_ebp: register_t,
20 pub mc_isp: register_t,
21 pub mc_ebx: register_t,
22 pub mc_edx: register_t,
23 pub mc_ecx: register_t,
24 pub mc_eax: register_t,
25 pub mc_trapno: register_t,
26 pub mc_err: register_t,
27 pub mc_eip: register_t,
28 pub mc_cs: register_t,
29 pub mc_eflags: register_t,
30 pub mc_esp: register_t,
31 pub mc_ss: register_t,
32 pub mc_len: c_int,
33 pub mc_fpformat: c_int,
34 pub mc_ownedfp: c_int,
35 pub mc_flags: register_t,
36 pub mc_fpstate: [c_int; 128],
37 pub mc_fsbase: register_t,
38 pub mc_gsbase: register_t,
39 pub mc_xfpustate: register_t,
40 pub mc_xfpustate_len: register_t,
41 pub mc_spare2: [c_int; 4],
42 }
43 }
44
45 cfg_if! {
46 if #[cfg(feature = "extra_traits")] {
47 impl PartialEq for mcontext_t {
48 fn eq(&self, other: &mcontext_t) -> bool {
49 self.mc_onstack == other.mc_onstack
50 && self.mc_gs == other.mc_gs
51 && self.mc_fs == other.mc_fs
52 && self.mc_es == other.mc_es
53 && self.mc_ds == other.mc_ds
54 && self.mc_edi == other.mc_edi
55 && self.mc_esi == other.mc_esi
56 && self.mc_ebp == other.mc_ebp
57 && self.mc_isp == other.mc_isp
58 && self.mc_ebx == other.mc_ebx
59 && self.mc_edx == other.mc_edx
60 && self.mc_ecx == other.mc_ecx
61 && self.mc_eax == other.mc_eax
62 && self.mc_trapno == other.mc_trapno
63 && self.mc_err == other.mc_err
64 && self.mc_eip == other.mc_eip
65 && self.mc_cs == other.mc_cs
66 && self.mc_eflags == other.mc_eflags
67 && self.mc_esp == other.mc_esp
68 && self.mc_ss == other.mc_ss
69 && self.mc_len == other.mc_len
70 && self.mc_fpformat == other.mc_fpformat
71 && self.mc_ownedfp == other.mc_ownedfp
72 && self.mc_flags == other.mc_flags
73 && self
74 .mc_fpstate
75 .iter()
76 .zip(other.mc_fpstate.iter())
77 .all(|(a, b)| a == b)
78 && self.mc_fsbase == other.mc_fsbase
79 && self.mc_gsbase == other.mc_gsbase
80 && self.mc_xfpustate == other.mc_xfpustate
81 && self.mc_xfpustate_len == other.mc_xfpustate_len
82 && self
83 .mc_spare2
84 .iter()
85 .zip(other.mc_spare2.iter())
86 .all(|(a, b)| a == b)
87 }
88 }
89 impl Eq for mcontext_t {}
90 impl fmt::Debug for mcontext_t {
91 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
92 f.debug_struct("mcontext_t")
93 .field("mc_onstack", &self.mc_onstack)
94 .field("mc_gs", &self.mc_gs)
95 .field("mc_fs", &self.mc_fs)
96 .field("mc_es", &self.mc_es)
97 .field("mc_ds", &self.mc_ds)
98 .field("mc_edi", &self.mc_edi)
99 .field("mc_esi", &self.mc_esi)
100 .field("mc_ebp", &self.mc_ebp)
101 .field("mc_isp", &self.mc_isp)
102 .field("mc_ebx", &self.mc_ebx)
103 .field("mc_edx", &self.mc_edx)
104 .field("mc_ecx", &self.mc_ecx)
105 .field("mc_eax", &self.mc_eax)
106 .field("mc_trapno", &self.mc_trapno)
107 .field("mc_err", &self.mc_err)
108 .field("mc_eip", &self.mc_eip)
109 .field("mc_cs", &self.mc_cs)
110 .field("mc_eflags", &self.mc_eflags)
111 .field("mc_esp", &self.mc_esp)
112 .field("mc_ss", &self.mc_ss)
113 .field("mc_len", &self.mc_len)
114 .field("mc_fpformat", &self.mc_fpformat)
115 .field("mc_ownedfp", &self.mc_ownedfp)
116 .field("mc_flags", &self.mc_flags)
117 .field("mc_fpstate", &self.mc_fpstate)
118 .field("mc_fsbase", &self.mc_fsbase)
119 .field("mc_gsbase", &self.mc_gsbase)
120 .field("mc_xfpustate", &self.mc_xfpustate)
121 .field("mc_xfpustate_len", &self.mc_xfpustate_len)
122 .field("mc_spare2", &self.mc_spare2)
123 .finish()
124 }
125 }
126 impl hash::Hash for mcontext_t {
127 fn hash<H: hash::Hasher>(&self, state: &mut H) {
128 self.mc_onstack.hash(state);
129 self.mc_gs.hash(state);
130 self.mc_fs.hash(state);
131 self.mc_es.hash(state);
132 self.mc_ds.hash(state);
133 self.mc_edi.hash(state);
134 self.mc_esi.hash(state);
135 self.mc_ebp.hash(state);
136 self.mc_isp.hash(state);
137 self.mc_ebx.hash(state);
138 self.mc_edx.hash(state);
139 self.mc_ecx.hash(state);
140 self.mc_eax.hash(state);
141 self.mc_trapno.hash(state);
142 self.mc_err.hash(state);
143 self.mc_eip.hash(state);
144 self.mc_cs.hash(state);
145 self.mc_eflags.hash(state);
146 self.mc_esp.hash(state);
147 self.mc_ss.hash(state);
148 self.mc_len.hash(state);
149 self.mc_fpformat.hash(state);
150 self.mc_ownedfp.hash(state);
151 self.mc_flags.hash(state);
152 self.mc_fpstate.hash(state);
153 self.mc_fsbase.hash(state);
154 self.mc_gsbase.hash(state);
155 self.mc_xfpustate.hash(state);
156 self.mc_xfpustate_len.hash(state);
157 self.mc_spare2.hash(state);
158 }
159 }
160 }
161 }
162
163 pub(crate) const _ALIGNBYTES: usize = mem::size_of::<c_long>() - 1;
164
165 pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4
166
167 pub const BIOCSRTIMEOUT: c_ulong = 0x8008426d;
168 pub const BIOCGRTIMEOUT: c_ulong = 0x4008426e;
169 pub const KINFO_FILE_SIZE: c_int = 1392;
170 pub const TIOCTIMESTAMP: c_ulong = 0x40087459;