Skip to content

Commit

Permalink
Auto merge of #3477 - devnexen:musl_user_fpxregs_struct, r=JohnTitor
Browse files Browse the repository at this point in the history
iadding yser_fpxregs_struct data to linux/musl i686.

close #3476
  • Loading branch information
bors committed Dec 15, 2023
2 parents c20e16f + 1198797 commit ccdae50
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions src/unix/linux_like/linux/musl/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,22 @@ s! {
}

s_no_extra_traits! {
pub struct user_fpxregs_struct {
pub cwd: ::c_ushort,
pub swd: ::c_ushort,
pub twd: ::c_ushort,
pub fop: ::c_ushort,
pub fip: ::c_long,
pub fcs: ::c_long,
pub foo: ::c_long,
pub fos: ::c_long,
pub mxcsr: ::c_long,
__reserved: ::c_long,
pub st_space: [::c_long; 32],
pub xmm_space: [::c_long; 32],
padding: [::c_long; 56],
}

pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
Expand All @@ -169,6 +185,64 @@ s_no_extra_traits! {

cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for user_fpxregs_struct {
fn eq(&self, other: &user_fpxregs_struct) -> bool {
self.cwd == other.cwd
&& self.swd == other.swd
&& self.twd == other.twd
&& self.fop == other.fop
&& self.fip == other.fip
&& self.fcs == other.fcs
&& self.foo == other.foo
&& self.fos == other.fos
&& self.mxcsr == other.mxcsr
// Ignore __reserved field
&& self.st_space == other.st_space
&& self.xmm_space == other.xmm_space
// Ignore padding field
}
}

impl Eq for user_fpxregs_struct {}

impl ::fmt::Debug for user_fpxregs_struct {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("user_fpxregs_struct")
.field("cwd", &self.cwd)
.field("swd", &self.swd)
.field("twd", &self.twd)
.field("fop", &self.fop)
.field("fip", &self.fip)
.field("fcs", &self.fcs)
.field("foo", &self.foo)
.field("fos", &self.fos)
.field("mxcsr", &self.mxcsr)
// Ignore __reserved field
.field("st_space", &self.st_space)
.field("xmm_space", &self.xmm_space)
// Ignore padding field
.finish()
}
}

impl ::hash::Hash for user_fpxregs_struct {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.cwd.hash(state);
self.swd.hash(state);
self.twd.hash(state);
self.fop.hash(state);
self.fip.hash(state);
self.fcs.hash(state);
self.foo.hash(state);
self.fos.hash(state);
self.mxcsr.hash(state);
// Ignore __reserved field
self.st_space.hash(state);
self.xmm_space.hash(state);
// Ignore padding field
}
}

impl PartialEq for ucontext_t {
fn eq(&self, other: &ucontext_t) -> bool {
self.uc_flags == other.uc_flags
Expand Down

0 comments on commit ccdae50

Please sign in to comment.