From ac7f0fac2f34d4eed1f05e9d20f236149711ff87 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Sat, 7 May 2016 15:26:38 +0200 Subject: [PATCH 1/2] Refine defininition of mcontext_t on x86-x64. --- src/unix/notbsd/linux/other/b64/x86_64.rs | 29 ++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/unix/notbsd/linux/other/b64/x86_64.rs b/src/unix/notbsd/linux/other/b64/x86_64.rs index 6903c627..7103267d 100644 --- a/src/unix/notbsd/linux/other/b64/x86_64.rs +++ b/src/unix/notbsd/linux/other/b64/x86_64.rs @@ -4,6 +4,7 @@ pub type c_char = i8; pub type wchar_t = i32; pub type nlink_t = u64; pub type blksize_t = i64; +pub type greg_t = i64; s! { pub struct stat { @@ -52,8 +53,34 @@ s! { __size: [u64; 7] } + pub struct _libc_fpxreg { + pub significand: [u16; 4], + pub exponent: u16, + __private: [u16; 3], + } + + pub struct _libc_xmmreg { + pub element: [u32; 4], + } + + pub struct _libc_fpstate { + pub cwd: u16, + pub swd: u16, + pub ftw: u16, + pub fop: u16, + pub rip: u64, + pub rdp: u64, + pub mxcsr: u32, + pub mxcr_mask: u32, + pub _st: [_libc_fpxreg; 8], + pub _xmm: [_libc_xmmreg; 16], + __private: [u64; 12], + } + pub struct mcontext_t { - __private: [u64; 32], + pub gregs: [greg_t; 23], + pub fpregs: *mut _libc_fpstate, + __private: [u64; 8], } pub struct ucontext_t { From 7c0c28f55f4a567747b2b45e5bc1213badc5e54c Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Sat, 7 May 2016 16:17:42 +0200 Subject: [PATCH 2/2] Refine definition of mcontext_t on x86. --- src/unix/notbsd/linux/other/b32/x86.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/unix/notbsd/linux/other/b32/x86.rs b/src/unix/notbsd/linux/other/b32/x86.rs index 1b215a97..e6d78dea 100644 --- a/src/unix/notbsd/linux/other/b32/x86.rs +++ b/src/unix/notbsd/linux/other/b32/x86.rs @@ -1,9 +1,30 @@ pub type c_char = i8; pub type wchar_t = i32; +pub type greg_t = i32; s! { + pub struct _libc_fpreg { + pub significand: [u16; 4], + pub exponent: u16, + } + + pub struct _libc_fpstate { + pub cw: ::c_ulong, + pub sw: ::c_ulong, + pub tag: ::c_ulong, + pub ipoff: ::c_ulong, + pub cssel: ::c_ulong, + pub dataoff: ::c_ulong, + pub datasel: ::c_ulong, + pub _st: [_libc_fpreg; 8], + pub status: ::c_ulong, + } + pub struct mcontext_t { - __private: [u32; 22] + pub gregs: [greg_t; 19], + pub fpregs: *mut _libc_fpstate, + pub oldmask: ::c_ulong, + pub cr2: ::c_ulong, } pub struct ucontext_t {