|
| 1 | +pub type greg_t = ::c_long; |
| 2 | + |
| 3 | +s! { |
| 4 | + pub struct __c_anonymous_fpchip_state { |
| 5 | + pub cw: u16, |
| 6 | + pub sw: u16, |
| 7 | + pub fctw: u8, |
| 8 | + pub __fx_rsvd: u8, |
| 9 | + pub fop: u16, |
| 10 | + pub rip: u64, |
| 11 | + pub rdp: u64, |
| 12 | + pub mxcsr: u32, |
| 13 | + pub mxcsr_mask: u32, |
| 14 | + pub st: [::upad128_t; 8], |
| 15 | + pub xmm: [::upad128_t; 16], |
| 16 | + pub __fx_ign: [::upad128_t; 6], |
| 17 | + pub status: u32, |
| 18 | + pub xstatus: u32, |
| 19 | + } |
| 20 | +} |
| 21 | + |
| 22 | +s_no_extra_traits! { |
| 23 | + #[cfg(libc_union)] |
| 24 | + pub union __c_anonymous_fp_reg_set { |
| 25 | + pub fpchip_state: __c_anonymous_fpchip_state, |
| 26 | + pub f_fpregs: [[u32; 13]; 10], |
| 27 | + } |
| 28 | + |
| 29 | + pub struct fpregset_t { |
| 30 | + pub fp_reg_set: __c_anonymous_fp_reg_set, |
| 31 | + } |
| 32 | + |
| 33 | + pub struct mcontext_t { |
| 34 | + pub gregs: [::greg_t; 28], |
| 35 | + pub fpgregs: fpregset_t, |
| 36 | + } |
| 37 | + |
| 38 | + pub struct ucontext_t { |
| 39 | + pub uc_flags: ::c_ulong, |
| 40 | + pub uc_link: *mut ucontext_t, |
| 41 | + pub uc_sigmask: ::sigset_t, |
| 42 | + pub uc_stack: ::stack_t, |
| 43 | + pub uc_mcontext: mcontext_t, |
| 44 | + pub uc_filler: [::c_long; 5], |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +cfg_if! { |
| 49 | + if #[cfg(feature = "extra_traits")] { |
| 50 | + #[cfg(libc_union)] |
| 51 | + impl PartialEq for __c_anonymous_fp_reg_set { |
| 52 | + fn eq(&self, other: &__c_anonymous_fp_reg_set) -> bool { |
| 53 | + unsafe { |
| 54 | + self.fpchip_state == other.fpchip_state || |
| 55 | + self. |
| 56 | + f_fpregs. |
| 57 | + iter(). |
| 58 | + zip(other.f_fpregs.iter()). |
| 59 | + all(|(a, b)| a == b) |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | + #[cfg(libc_union)] |
| 64 | + impl Eq for __c_anonymous_fp_reg_set {} |
| 65 | + #[cfg(libc_union)] |
| 66 | + impl ::fmt::Debug for __c_anonymous_fp_reg_set { |
| 67 | + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { |
| 68 | + unsafe { |
| 69 | + f.debug_struct("__c_anonymous_fp_reg_set") |
| 70 | + .field("fpchip_state", &{self.fpchip_state}) |
| 71 | + .field("f_fpregs", &{self.f_fpregs}) |
| 72 | + .finish() |
| 73 | + } |
| 74 | + } |
| 75 | + } |
| 76 | + impl PartialEq for fpregset_t { |
| 77 | + fn eq(&self, other: &fpregset_t) -> bool { |
| 78 | + self.fp_reg_set == other.fp_reg_set |
| 79 | + } |
| 80 | + } |
| 81 | + impl Eq for fpregset_t {} |
| 82 | + impl ::fmt::Debug for fpregset_t { |
| 83 | + fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result { |
| 84 | + f.debug_struct("fpregset_t") |
| 85 | + .field("fp_reg_set", &self.fp_reg_set) |
| 86 | + .finish() |
| 87 | + } |
| 88 | + } |
| 89 | + impl PartialEq for mcontext_t { |
| 90 | + fn eq(&self, other: &mcontext_t) -> bool { |
| 91 | + self.gregs == other.gregs && |
| 92 | + self.fpgregs == other.fpgregs |
| 93 | + } |
| 94 | + } |
| 95 | + impl Eq for mcontext_t {} |
| 96 | + impl ::fmt::Debug for mcontext_t { |
| 97 | + fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result { |
| 98 | + f.debug_struct("mcontext_t") |
| 99 | + .field("gregs", &self.gregs) |
| 100 | + .field("fpgregs", &self.fpgregs) |
| 101 | + .finish() |
| 102 | + } |
| 103 | + } |
| 104 | + impl PartialEq for ucontext_t { |
| 105 | + fn eq(&self, other: &ucontext_t) -> bool { |
| 106 | + self.uc_flags == other.uc_flags |
| 107 | + && self.uc_link == other.uc_link |
| 108 | + && self.uc_sigmask == other.uc_sigmask |
| 109 | + && self.uc_stack == other.uc_stack |
| 110 | + && self.uc_mcontext == other.uc_mcontext |
| 111 | + && self.uc_filler == other.uc_filler |
| 112 | + } |
| 113 | + } |
| 114 | + impl Eq for ucontext_t {} |
| 115 | + impl ::fmt::Debug for ucontext_t { |
| 116 | + fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result { |
| 117 | + f.debug_struct("ucontext_t") |
| 118 | + .field("uc_flags", &self.uc_flags) |
| 119 | + .field("uc_link", &self.uc_link) |
| 120 | + .field("uc_sigmask", &self.uc_sigmask) |
| 121 | + .field("uc_stack", &self.uc_stack) |
| 122 | + .field("uc_mcontext", &self.uc_mcontext) |
| 123 | + .field("uc_filler", &self.uc_filler) |
| 124 | + .finish() |
| 125 | + } |
| 126 | + } |
| 127 | + |
| 128 | + } |
| 129 | +} |
0 commit comments