Author: jhibbits
Date: Fri Jan 24 02:57:00 2014
New Revision: 261095
URL: http://svnweb.freebsd.org/changeset/base/261095

Log:
  Fix 32-bit signal handling on ppc64.  This was broken when the PSL_USERSTATIC
  macro was changed.  Since copying 64-bit srr1 into 32-bit srr1 drops the upper
  32 bits, any bits set in the context were dropped, meaning the context check
  fails.  Since 32-bit set_context can't change those bits anyway, copy the ones
  from the current context (td->td_frame) before calling set_context().
  
  MFC after:    3 weeks

Modified:
  head/sys/powerpc/powerpc/exec_machdep.c

Modified: head/sys/powerpc/powerpc/exec_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/exec_machdep.c     Fri Jan 24 00:42:18 2014        
(r261094)
+++ head/sys/powerpc/powerpc/exec_machdep.c     Fri Jan 24 02:57:00 2014        
(r261095)
@@ -752,6 +752,7 @@ set_mcontext32(struct thread *td, const 
        memcpy(mcp64.mc_av,mcp->mc_av,sizeof(mcp64.mc_av));
        for (i = 0; i < 42; i++)
                mcp64.mc_frame[i] = mcp->mc_frame[i];
+       mcp64.mc_srr1 |= (td->td_frame->srr1 & 0xFFFFFFFF00000000ULL);
        memcpy(mcp64.mc_fpreg,mcp->mc_fpreg,sizeof(mcp64.mc_fpreg));
 
        error = set_mcontext(td, &mcp64);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to