| 1 |
use crate::prelude::*; |
| 2 |
|
| 3 |
pub type clock_t = u32; |
| 4 |
pub type wchar_t = i32; |
| 5 |
pub type time_t = i64; |
| 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_vers: c_int, |
| 13 |
pub mc_flags: c_int, |
| 14 |
pub mc_onstack: c_int, |
| 15 |
pub mc_len: c_int, |
| 16 |
pub mc_avec: [u64; 64], |
| 17 |
pub mc_av: [u32; 2], |
| 18 |
pub mc_frame: [crate::register_t; 42], |
| 19 |
pub mc_fpreg: [u64; 33], |
| 20 |
pub mc_vsxfpreg: [u64; 32], |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
cfg_if! { |
| 25 |
if #[cfg(feature = "extra_traits")] { |
| 26 |
impl PartialEq for mcontext_t { |
| 27 |
fn eq(&self, other: &mcontext_t) -> bool { |
| 28 |
self.mc_vers == other.mc_vers |
| 29 |
&& self.mc_flags == other.mc_flags |
| 30 |
&& self.mc_onstack == other.mc_onstack |
| 31 |
&& self.mc_len == other.mc_len |
| 32 |
&& self.mc_avec == other.mc_avec |
| 33 |
&& self.mc_av == other.mc_av |
| 34 |
&& self.mc_frame == other.mc_frame |
| 35 |
&& self.mc_fpreg == other.mc_fpreg |
| 36 |
&& self.mc_vsxfpreg == other.mc_vsxfpreg |
| 37 |
} |
| 38 |
} |
| 39 |
impl Eq for mcontext_t {} |
| 40 |
impl fmt::Debug for mcontext_t { |
| 41 |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 42 |
f.debug_struct("mcontext_t") |
| 43 |
.field("mc_vers", &self.mc_vers) |
| 44 |
.field("mc_flags", &self.mc_flags) |
| 45 |
.field("mc_onstack", &self.mc_onstack) |
| 46 |
.field("mc_len", &self.mc_len) |
| 47 |
.field("mc_avec", &self.mc_avec) |
| 48 |
.field("mc_av", &self.mc_av) |
| 49 |
.field("mc_frame", &self.mc_frame) |
| 50 |
.field("mc_fpreg", &self.mc_fpreg) |
| 51 |
.field("mc_vsxfpreg", &self.mc_vsxfpreg) |
| 52 |
.finish() |
| 53 |
} |
| 54 |
} |
| 55 |
impl hash::Hash for mcontext_t { |
| 56 |
fn hash<H: hash::Hasher>(&self, state: &mut H) { |
| 57 |
self.mc_vers.hash(state); |
| 58 |
self.mc_flags.hash(state); |
| 59 |
self.mc_onstack.hash(state); |
| 60 |
self.mc_len.hash(state); |
| 61 |
self.mc_avec.hash(state); |
| 62 |
self.mc_av.hash(state); |
| 63 |
self.mc_frame.hash(state); |
| 64 |
self.mc_fpreg.hash(state); |
| 65 |
self.mc_vsxfpreg.hash(state); |
| 66 |
} |
| 67 |
} |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
pub(crate) const _ALIGNBYTES: usize = mem::size_of::<c_int>() - 1; |
| 72 |
|
| 73 |
pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; |
| 74 |
pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; |
| 75 |
pub const MAP_32BIT: c_int = 0x00080000; |
| 76 |
pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4 |
| 77 |
pub const TIOCTIMESTAMP: c_ulong = 0x40107459; |