From owner-svn-src-head@freebsd.org Thu Jul 9 17:26:57 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE96B997C54; Thu, 9 Jul 2015 17:26:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EB9F15E2; Thu, 9 Jul 2015 17:26:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t69HQvOh071766; Thu, 9 Jul 2015 17:26:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t69HQvgx071765; Thu, 9 Jul 2015 17:26:57 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201507091726.t69HQvgx071765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 9 Jul 2015 17:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285334 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2015 17:26:57 -0000 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); }