aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/unix/notbsd/linux/other/b64/x86_64.rs')
-rw-r--r--libc/src/unix/notbsd/linux/other/b64/x86_64.rs144
1 files changed, 121 insertions, 23 deletions
diff --git a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
index 0d7137e..79f27e0 100644
--- a/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
+++ b/libc/src/unix/notbsd/linux/other/b64/x86_64.rs
@@ -112,20 +112,6 @@ s! {
__private: [u64; 12],
}
- pub struct user_fpregs_struct {
- pub cwd: ::c_ushort,
- pub swd: ::c_ushort,
- pub ftw: ::c_ushort,
- pub fop: ::c_ushort,
- pub rip: ::c_ulonglong,
- pub rdp: ::c_ulonglong,
- pub mxcsr: ::c_uint,
- pub mxcr_mask: ::c_uint,
- pub st_space: [::c_uint; 32],
- pub xmm_space: [::c_uint; 64],
- padding: [::c_uint; 24],
- }
-
pub struct user_regs_struct {
pub r15: ::c_ulonglong,
pub r14: ::c_ulonglong,
@@ -184,15 +170,6 @@ s! {
__private: [u64; 8],
}
- pub struct ucontext_t {
- pub uc_flags: ::c_ulong,
- pub uc_link: *mut ucontext_t,
- pub uc_stack: ::stack_t,
- pub uc_mcontext: mcontext_t,
- pub uc_sigmask: ::sigset_t,
- __private: [u8; 512],
- }
-
pub struct ipc_perm {
pub __key: ::key_t,
pub uid: ::uid_t,
@@ -232,6 +209,127 @@ s! {
}
}
+s_no_extra_traits! {
+ pub struct user_fpregs_struct {
+ pub cwd: ::c_ushort,
+ pub swd: ::c_ushort,
+ pub ftw: ::c_ushort,
+ pub fop: ::c_ushort,
+ pub rip: ::c_ulonglong,
+ pub rdp: ::c_ulonglong,
+ pub mxcsr: ::c_uint,
+ pub mxcr_mask: ::c_uint,
+ pub st_space: [::c_uint; 32],
+ pub xmm_space: [::c_uint; 64],
+ padding: [::c_uint; 24],
+ }
+
+ pub struct ucontext_t {
+ pub uc_flags: ::c_ulong,
+ pub uc_link: *mut ucontext_t,
+ pub uc_stack: ::stack_t,
+ pub uc_mcontext: mcontext_t,
+ pub uc_sigmask: ::sigset_t,
+ __private: [u8; 512],
+ __ssp: [::c_ulonglong; 4],
+ }
+}
+
+cfg_if! {
+ if #[cfg(feature = "extra_traits")] {
+ impl PartialEq for user_fpregs_struct {
+ fn eq(&self, other: &user_fpregs_struct) -> bool {
+ self.cwd == other.cwd
+ && self.swd == other.swd
+ && self.ftw == other.ftw
+ && self.fop == other.fop
+ && self.rip == other.rip
+ && self.rdp == other.rdp
+ && self.mxcsr == other.mxcsr
+ && self.mxcr_mask == other.mxcr_mask
+ && self.st_space == other.st_space
+ && self
+ .xmm_space
+ .iter()
+ .zip(other.xmm_space.iter())
+ .all(|(a,b)| a == b)
+ // Ignore padding field
+ }
+ }
+
+ impl Eq for user_fpregs_struct {}
+
+ impl ::fmt::Debug for user_fpregs_struct {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("user_fpregs_struct")
+ .field("cwd", &self.cwd)
+ .field("ftw", &self.ftw)
+ .field("fop", &self.fop)
+ .field("rip", &self.rip)
+ .field("rdp", &self.rdp)
+ .field("mxcsr", &self.mxcsr)
+ .field("mxcr_mask", &self.mxcr_mask)
+ .field("st_space", &self.st_space)
+ // FIXME: .field("xmm_space", &self.xmm_space)
+ // Ignore padding field
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for user_fpregs_struct {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.cwd.hash(state);
+ self.ftw.hash(state);
+ self.fop.hash(state);
+ self.rip.hash(state);
+ self.rdp.hash(state);
+ self.mxcsr.hash(state);
+ self.mxcr_mask.hash(state);
+ 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
+ && self.uc_link == other.uc_link
+ && self.uc_stack == other.uc_stack
+ && self.uc_mcontext == other.uc_mcontext
+ && self.uc_sigmask == other.uc_sigmask
+ // Ignore __private field
+ }
+ }
+
+ impl Eq for ucontext_t {}
+
+ impl ::fmt::Debug for ucontext_t {
+ fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
+ f.debug_struct("ucontext_t")
+ .field("uc_flags", &self.uc_flags)
+ .field("uc_link", &self.uc_link)
+ .field("uc_stack", &self.uc_stack)
+ .field("uc_mcontext", &self.uc_mcontext)
+ .field("uc_sigmask", &self.uc_sigmask)
+ // Ignore __private field
+ .finish()
+ }
+ }
+
+ impl ::hash::Hash for ucontext_t {
+ fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
+ self.uc_flags.hash(state);
+ self.uc_link.hash(state);
+ self.uc_stack.hash(state);
+ self.uc_mcontext.hash(state);
+ self.uc_sigmask.hash(state);
+ // Ignore __private field
+ }
+ }
+ }
+}
+
pub const TIOCGSOFTCAR: ::c_ulong = 0x5419;
pub const TIOCSSOFTCAR: ::c_ulong = 0x541A;