Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iadding yser_fpxregs_struct data to linux/musl i686. #3477

Merged
merged 1 commit into from Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/unix/linux_like/linux/musl/b32/x86/mod.rs
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