4848 }
4949
5050 pub struct user_regs_struct {
51- pub r15: :: c_ulonglong,
52- pub r14: :: c_ulonglong,
53- pub r13: :: c_ulonglong,
54- pub r12: :: c_ulonglong,
55- pub rbp: :: c_ulonglong,
56- pub rbx: :: c_ulonglong,
57- pub r11: :: c_ulonglong,
58- pub r10: :: c_ulonglong,
59- pub r9: :: c_ulonglong,
60- pub r8: :: c_ulonglong,
61- pub rax: :: c_ulonglong,
62- pub rcx: :: c_ulonglong,
63- pub rdx: :: c_ulonglong,
64- pub rsi: :: c_ulonglong,
65- pub rdi: :: c_ulonglong,
66- pub orig_rax: :: c_ulonglong,
67- pub rip: :: c_ulonglong,
68- pub cs: :: c_ulonglong,
69- pub eflags: :: c_ulonglong,
70- pub rsp: :: c_ulonglong,
71- pub ss: :: c_ulonglong,
72- pub fs_base: :: c_ulonglong,
73- pub gs_base: :: c_ulonglong,
74- pub ds: :: c_ulonglong,
75- pub es: :: c_ulonglong,
76- pub fs: :: c_ulonglong,
77- pub gs: :: c_ulonglong,
51+ pub r15: :: c_ulong,
52+ pub r14: :: c_ulong,
53+ pub r13: :: c_ulong,
54+ pub r12: :: c_ulong,
55+ pub rbp: :: c_ulong,
56+ pub rbx: :: c_ulong,
57+ pub r11: :: c_ulong,
58+ pub r10: :: c_ulong,
59+ pub r9: :: c_ulong,
60+ pub r8: :: c_ulong,
61+ pub rax: :: c_ulong,
62+ pub rcx: :: c_ulong,
63+ pub rdx: :: c_ulong,
64+ pub rsi: :: c_ulong,
65+ pub rdi: :: c_ulong,
66+ pub orig_rax: :: c_ulong,
67+ pub rip: :: c_ulong,
68+ pub cs: :: c_ulong,
69+ pub eflags: :: c_ulong,
70+ pub rsp: :: c_ulong,
71+ pub ss: :: c_ulong,
72+ pub fs_base: :: c_ulong,
73+ pub gs_base: :: c_ulong,
74+ pub ds: :: c_ulong,
75+ pub es: :: c_ulong,
76+ pub fs: :: c_ulong,
77+ pub gs: :: c_ulong,
78+ }
79+
80+ pub struct user {
81+ pub regs: user_regs_struct,
82+ pub u_fpvalid: :: c_int,
83+ pub i387: user_fpregs_struct,
84+ pub u_tsize: :: c_ulong,
85+ pub u_dsize: :: c_ulong,
86+ pub u_ssize: :: c_ulong,
87+ pub start_code: :: c_ulong,
88+ pub start_stack: :: c_ulong,
89+ pub signal: :: c_long,
90+ __reserved: :: c_int,
91+ #[ cfg( target_pointer_width = "32" ) ]
92+ __pad1: u32 ,
93+ pub u_ar0: * mut user_regs_struct,
94+ #[ cfg( target_pointer_width = "32" ) ]
95+ __pad2: u32 ,
96+ pub u_fpstate: * mut user_fpregs_struct,
97+ pub magic: :: c_ulong,
98+ pub u_comm: [ :: c_char; 32 ] ,
99+ pub u_debugreg: [ :: c_ulong; 8 ] ,
78100 }
79101
80102 pub struct mcontext_t {
95117}
96118
97119s_no_extra_traits ! {
120+ pub struct user_fpregs_struct {
121+ pub cwd: :: c_ushort,
122+ pub swd: :: c_ushort,
123+ pub ftw: :: c_ushort,
124+ pub fop: :: c_ushort,
125+ pub rip: :: c_ulonglong,
126+ pub rdp: :: c_ulonglong,
127+ pub mxcsr: :: c_uint,
128+ pub mxcr_mask: :: c_uint,
129+ pub st_space: [ :: c_uint; 32 ] ,
130+ pub xmm_space: [ :: c_uint; 64 ] ,
131+ padding: [ :: c_uint; 24 ] ,
132+ }
133+
98134 pub struct ucontext_t {
99135 pub uc_flags: :: c_ulong,
100136 pub uc_link: * mut ucontext_t,
@@ -107,6 +143,60 @@ s_no_extra_traits!{
107143
108144cfg_if ! {
109145 if #[ cfg( feature = "extra_traits" ) ] {
146+ impl PartialEq for user_fpregs_struct {
147+ fn eq( & self , other: & user_fpregs_struct) -> bool {
148+ self . cwd == other. cwd
149+ && self . swd == other. swd
150+ && self . ftw == other. ftw
151+ && self . fop == other. fop
152+ && self . rip == other. rip
153+ && self . rdp == other. rdp
154+ && self . mxcsr == other. mxcsr
155+ && self . mxcr_mask == other. mxcr_mask
156+ && self . st_space == other. st_space
157+ && self
158+ . xmm_space
159+ . iter( )
160+ . zip( other. xmm_space. iter( ) )
161+ . all( |( a, b) | a == b)
162+ // Ignore padding field
163+ }
164+ }
165+
166+ impl Eq for user_fpregs_struct { }
167+
168+ impl :: fmt:: Debug for user_fpregs_struct {
169+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
170+ f. debug_struct( "user_fpregs_struct" )
171+ . field( "cwd" , & self . cwd)
172+ . field( "ftw" , & self . ftw)
173+ . field( "fop" , & self . fop)
174+ . field( "rip" , & self . rip)
175+ . field( "rdp" , & self . rdp)
176+ . field( "mxcsr" , & self . mxcsr)
177+ . field( "mxcr_mask" , & self . mxcr_mask)
178+ . field( "st_space" , & self . st_space)
179+ // FIXME: .field("xmm_space", &self.xmm_space)
180+ // Ignore padding field
181+ . finish( )
182+ }
183+ }
184+
185+ impl :: hash:: Hash for user_fpregs_struct {
186+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
187+ self . cwd. hash( state) ;
188+ self . ftw. hash( state) ;
189+ self . fop. hash( state) ;
190+ self . rip. hash( state) ;
191+ self . rdp. hash( state) ;
192+ self . mxcsr. hash( state) ;
193+ self . mxcr_mask. hash( state) ;
194+ self . st_space. hash( state) ;
195+ self . xmm_space. hash( state) ;
196+ // Ignore padding field
197+ }
198+ }
199+
110200 impl PartialEq for ucontext_t {
111201 fn eq( & self , other: & ucontext_t) -> bool {
112202 self . uc_flags == other. uc_flags
0 commit comments