Skip to content

Commit ac7f0fa

Browse files
committed
Refine defininition of mcontext_t on x86-x64.
1 parent a04a52a commit ac7f0fa

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/unix/notbsd/linux/other/b64/x86_64.rs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pub type c_char = i8;
44
pub type wchar_t = i32;
55
pub type nlink_t = u64;
66
pub type blksize_t = i64;
7+
pub type greg_t = i64;
78

89
s! {
910
pub struct stat {
@@ -52,8 +53,34 @@ s! {
5253
__size: [u64; 7]
5354
}
5455

56+
pub struct _libc_fpxreg {
57+
pub significand: [u16; 4],
58+
pub exponent: u16,
59+
__private: [u16; 3],
60+
}
61+
62+
pub struct _libc_xmmreg {
63+
pub element: [u32; 4],
64+
}
65+
66+
pub struct _libc_fpstate {
67+
pub cwd: u16,
68+
pub swd: u16,
69+
pub ftw: u16,
70+
pub fop: u16,
71+
pub rip: u64,
72+
pub rdp: u64,
73+
pub mxcsr: u32,
74+
pub mxcr_mask: u32,
75+
pub _st: [_libc_fpxreg; 8],
76+
pub _xmm: [_libc_xmmreg; 16],
77+
__private: [u64; 12],
78+
}
79+
5580
pub struct mcontext_t {
56-
__private: [u64; 32],
81+
pub gregs: [greg_t; 23],
82+
pub fpregs: *mut _libc_fpstate,
83+
__private: [u64; 8],
5784
}
5885

5986
pub struct ucontext_t {

0 commit comments

Comments
 (0)