@@ -17,5 +17,67 @@ cfg_if! {
17
17
}
18
18
}
19
19
20
+ s_no_extra_traits ! {
21
+ #[ repr( align( 16 ) ) ]
22
+ pub struct mcontext_t {
23
+ pub mc_vers: :: c_int,
24
+ pub mc_flags: :: c_int,
25
+ pub mc_onstack: :: c_int,
26
+ pub mc_len: :: c_int,
27
+ pub mc_avec: [ u64 ; 64 ] ,
28
+ pub mc_av: [ u32 ; 2 ] ,
29
+ pub mc_frame: [ :: register_t; 42 ] ,
30
+ pub mc_fpreg: [ u64 ; 33 ] ,
31
+ pub mc_vsxfpreg: [ u64 ; 32 ] ,
32
+ }
33
+ }
34
+
35
+ cfg_if ! {
36
+ if #[ cfg( feature = "extra_traits" ) ] {
37
+ impl PartialEq for mcontext_t {
38
+ fn eq( & self , other: & mcontext_t) -> bool {
39
+ self . mc_vers == other. mc_vers &&
40
+ self . mc_flags == other. mc_flags &&
41
+ self . mc_onstack == other. mc_onstack &&
42
+ self . mc_len == other. mc_len &&
43
+ self . mc_avec == other. mc_avec &&
44
+ self . mc_av == other. mc_av &&
45
+ self . mc_frame == other. mc_frame &&
46
+ self . mc_fpreg == other. mc_fpreg &&
47
+ self . mc_vsxfpreg == other. mc_vsxfpreg
48
+ }
49
+ }
50
+ impl Eq for mcontext_t { }
51
+ impl :: fmt:: Debug for mcontext_t {
52
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
53
+ f. debug_struct( "mcontext_t" )
54
+ . field( "mc_vers" , & self . mc_vers)
55
+ . field( "mc_flags" , & self . mc_flags)
56
+ . field( "mc_onstack" , & self . mc_onstack)
57
+ . field( "mc_len" , & self . mc_len)
58
+ . field( "mc_avec" , & self . mc_avec)
59
+ . field( "mc_av" , & self . mc_av)
60
+ . field( "mc_frame" , & self . mc_frame)
61
+ . field( "mc_fpreg" , & self . mc_fpreg)
62
+ . field( "mc_vsxfpreg" , & self . mc_vsxfpreg)
63
+ . finish( )
64
+ }
65
+ }
66
+ impl :: hash:: Hash for mcontext_t {
67
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
68
+ self . mc_vers. hash( state) ;
69
+ self . mc_flags. hash( state) ;
70
+ self . mc_onstack. hash( state) ;
71
+ self . mc_len. hash( state) ;
72
+ self . mc_avec. hash( state) ;
73
+ self . mc_av. hash( state) ;
74
+ self . mc_frame. hash( state) ;
75
+ self . mc_fpreg. hash( state) ;
76
+ self . mc_vsxfpreg. hash( state) ;
77
+ }
78
+ }
79
+ }
80
+ }
81
+
20
82
pub const MAP_32BIT : :: c_int = 0x00080000 ;
21
83
pub const MINSIGSTKSZ : :: size_t = 2048 ; // 512 * 4
0 commit comments