@@ -546,8 +546,9 @@ cfg_if! {
546546 self . mc_ss == other. mc_ss &&
547547 self . mc_len == other. mc_len &&
548548 self . mc_fpformat == other. mc_fpformat &&
549- self . mc_ownedfp == other. mc_ownedfp
550- // FIXME: self.mc_fpregs == other.mc_fpregs
549+ self . mc_ownedfp == other. mc_ownedfp &&
550+ self . mc_fpregs. iter( ) . zip( other. mc_fpregs. iter( ) ) .
551+ all( |( a, b) | a == b)
551552 }
552553 }
553554 impl Eq for mcontext_t { }
@@ -583,10 +584,46 @@ cfg_if! {
583584 . field( "mc_len" , & self . mc_len)
584585 . field( "mc_fpformat" , & self . mc_fpformat)
585586 . field( "mc_ownedfp" , & self . mc_ownedfp)
586- // FIXME: .field("mc_fpregs", &self.mc_fpregs)
587+ . field( "mc_fpregs" , & self . mc_fpregs)
587588 . finish( )
588589 }
589590 }
591+ impl :: hash:: Hash for mcontext_t {
592+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
593+ self . mc_onstack. hash( state) ;
594+ self . mc_rdi. hash( state) ;
595+ self . mc_rsi. hash( state) ;
596+ self . mc_rdx. hash( state) ;
597+ self . mc_rcx. hash( state) ;
598+ self . mc_r8. hash( state) ;
599+ self . mc_r9. hash( state) ;
600+ self . mc_rax. hash( state) ;
601+ self . mc_rbx. hash( state) ;
602+ self . mc_rbp. hash( state) ;
603+ self . mc_r10. hash( state) ;
604+ self . mc_r11. hash( state) ;
605+ self . mc_r10. hash( state) ;
606+ self . mc_r11. hash( state) ;
607+ self . mc_r12. hash( state) ;
608+ self . mc_r13. hash( state) ;
609+ self . mc_r14. hash( state) ;
610+ self . mc_r15. hash( state) ;
611+ self . mc_xflags. hash( state) ;
612+ self . mc_trapno. hash( state) ;
613+ self . mc_addr. hash( state) ;
614+ self . mc_flags. hash( state) ;
615+ self . mc_err. hash( state) ;
616+ self . mc_rip. hash( state) ;
617+ self . mc_cs. hash( state) ;
618+ self . mc_rflags. hash( state) ;
619+ self . mc_rsp. hash( state) ;
620+ self . mc_ss. hash( state) ;
621+ self . mc_len. hash( state) ;
622+ self . mc_fpformat. hash( state) ;
623+ self . mc_ownedfp. hash( state) ;
624+ self . mc_fpregs. hash( state) ;
625+ }
626+ }
590627 impl PartialEq for ucontext_t {
591628 fn eq( & self , other: & ucontext_t) -> bool {
592629 self . uc_sigmask == other. uc_sigmask
@@ -610,6 +647,16 @@ cfg_if! {
610647 . finish( )
611648 }
612649 }
650+ impl :: hash:: Hash for ucontext_t {
651+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
652+ self . uc_sigmask. hash( state) ;
653+ self . uc_mcontext. hash( state) ;
654+ self . uc_link. hash( state) ;
655+ self . uc_stack. hash( state) ;
656+ self . uc_cofunc. hash( state) ;
657+ self . uc_arg. hash( state) ;
658+ }
659+ }
613660 }
614661}
615662
0 commit comments