Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2015 17:26:57 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285334 - head/sys/arm64/arm64
Message-ID:  <201507091726.t69HQvgx071765@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Thu Jul  9 17:26:56 2015
New Revision: 285334
URL: https://svnweb.freebsd.org/changeset/base/285334

Log:
  Clear the carry bit on the saved program state register when asked to
  clear the return value, it's used to indicate an error.
  
  Obtained from:	ABT Systems Ltd
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/arm64/arm64/machdep.c

Modified: head/sys/arm64/arm64/machdep.c
==============================================================================
--- head/sys/arm64/arm64/machdep.c	Thu Jul  9 17:25:02 2015	(r285333)
+++ head/sys/arm64/arm64/machdep.c	Thu Jul  9 17:26:56 2015	(r285334)
@@ -266,10 +266,13 @@ get_mcontext(struct thread *td, mcontext
 {
 	struct trapframe *tf = td->td_frame;
 
-	if (clear_ret & GET_MC_CLEAR_RET)
+	if (clear_ret & GET_MC_CLEAR_RET) {
 		mcp->mc_gpregs.gp_x[0] = 0;
-	else
+		mcp->mc_gpregs.gp_spsr = tf->tf_spsr & ~PSR_C;
+	} else {
 		mcp->mc_gpregs.gp_x[0] = tf->tf_x[0];
+		mcp->mc_gpregs.gp_spsr = tf->tf_spsr;
+	}
 
 	memcpy(&mcp->mc_gpregs.gp_x[1], &tf->tf_x[1],
 	    sizeof(mcp->mc_gpregs.gp_x[1]) * (nitems(mcp->mc_gpregs.gp_x) - 1));
@@ -277,7 +280,6 @@ get_mcontext(struct thread *td, mcontext
 	mcp->mc_gpregs.gp_sp = tf->tf_sp;
 	mcp->mc_gpregs.gp_lr = tf->tf_lr;
 	mcp->mc_gpregs.gp_elr = tf->tf_elr;
-	mcp->mc_gpregs.gp_spsr = tf->tf_spsr;
 
 	return (0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507091726.t69HQvgx071765>