@@ -584,8 +584,9 @@ cfg_if! {
584
584
self . mc_ss == other. mc_ss &&
585
585
self . mc_len == other. mc_len &&
586
586
self . mc_fpformat == other. mc_fpformat &&
587
- self . mc_ownedfp == other. mc_ownedfp
588
- // FIXME: self.mc_fpregs == other.mc_fpregs
587
+ self . mc_ownedfp == other. mc_ownedfp &&
588
+ self . mc_fpregs. iter( ) . zip( other. mc_fpregs. iter( ) ) .
589
+ all( |( a, b) | a == b)
589
590
}
590
591
}
591
592
impl Eq for mcontext_t { }
@@ -621,10 +622,46 @@ cfg_if! {
621
622
. field( "mc_len" , & self . mc_len)
622
623
. field( "mc_fpformat" , & self . mc_fpformat)
623
624
. field( "mc_ownedfp" , & self . mc_ownedfp)
624
- // FIXME: .field("mc_fpregs", &self.mc_fpregs)
625
+ . field( "mc_fpregs" , & self . mc_fpregs)
625
626
. finish( )
626
627
}
627
628
}
629
+ impl :: hash:: Hash for mcontext_t {
630
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
631
+ self . mc_onstack. hash( state) ;
632
+ self . mc_rdi. hash( state) ;
633
+ self . mc_rsi. hash( state) ;
634
+ self . mc_rdx. hash( state) ;
635
+ self . mc_rcx. hash( state) ;
636
+ self . mc_r8. hash( state) ;
637
+ self . mc_r9. hash( state) ;
638
+ self . mc_rax. hash( state) ;
639
+ self . mc_rbx. hash( state) ;
640
+ self . mc_rbp. hash( state) ;
641
+ self . mc_r10. hash( state) ;
642
+ self . mc_r11. hash( state) ;
643
+ self . mc_r10. hash( state) ;
644
+ self . mc_r11. hash( state) ;
645
+ self . mc_r12. hash( state) ;
646
+ self . mc_r13. hash( state) ;
647
+ self . mc_r14. hash( state) ;
648
+ self . mc_r15. hash( state) ;
649
+ self . mc_xflags. hash( state) ;
650
+ self . mc_trapno. hash( state) ;
651
+ self . mc_addr. hash( state) ;
652
+ self . mc_flags. hash( state) ;
653
+ self . mc_err. hash( state) ;
654
+ self . mc_rip. hash( state) ;
655
+ self . mc_cs. hash( state) ;
656
+ self . mc_rflags. hash( state) ;
657
+ self . mc_rsp. hash( state) ;
658
+ self . mc_ss. hash( state) ;
659
+ self . mc_len. hash( state) ;
660
+ self . mc_fpformat. hash( state) ;
661
+ self . mc_ownedfp. hash( state) ;
662
+ self . mc_fpregs. hash( state) ;
663
+ }
664
+ }
628
665
impl PartialEq for ucontext_t {
629
666
fn eq( & self , other: & ucontext_t) -> bool {
630
667
self . uc_sigmask == other. uc_sigmask
@@ -648,6 +685,16 @@ cfg_if! {
648
685
. finish( )
649
686
}
650
687
}
688
+ impl :: hash:: Hash for ucontext_t {
689
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
690
+ self . uc_sigmask. hash( state) ;
691
+ self . uc_mcontext. hash( state) ;
692
+ self . uc_link. hash( state) ;
693
+ self . uc_stack. hash( state) ;
694
+ self . uc_cofunc. hash( state) ;
695
+ self . uc_arg. hash( state) ;
696
+ }
697
+ }
651
698
}
652
699
}
653
700
0 commit comments