From owner-svn-src-head@freebsd.org Thu Aug 2 12:24:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 807CD10661BA; Thu, 2 Aug 2018 12:24:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2789B866EC; Thu, 2 Aug 2018 12:24:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02C5011A32; Thu, 2 Aug 2018 12:24:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w72COYJ8070603; Thu, 2 Aug 2018 12:24:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w72COYr3070602; Thu, 2 Aug 2018 12:24:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808021224.w72COYr3070602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 2 Aug 2018 12:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337129 - head/lib/libthread_db/arch/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/lib/libthread_db/arch/riscv X-SVN-Commit-Revision: 337129 X-SVN-Commit-Repository: base 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.27 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, 02 Aug 2018 12:24:35 -0000 Author: br Date: Thu Aug 2 12:24:34 2018 New Revision: 337129 URL: https://svnweb.freebsd.org/changeset/base/337129 Log: Implement pt_fpreg_to_ucontext(), pt_ucontext_to_fpreg(). Sponsored by: DARPA, AFRL Modified: head/lib/libthread_db/arch/riscv/libpthread_md.c Modified: head/lib/libthread_db/arch/riscv/libpthread_md.c ============================================================================== --- head/lib/libthread_db/arch/riscv/libpthread_md.c Thu Aug 2 12:21:39 2018 (r337128) +++ head/lib/libthread_db/arch/riscv/libpthread_md.c Thu Aug 2 12:24:34 2018 (r337129) @@ -80,15 +80,21 @@ pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r void pt_fpreg_to_ucontext(const struct fpreg *r __unused, ucontext_t *uc __unused) { + mcontext_t *mc = &uc->uc_mcontext; - /* RISCVTODO */ + memcpy(&mc->mc_fpregs, r, sizeof(*r)); + mc->mc_flags |= _MC_FP_VALID; } void pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused) { + const mcontext_t *mc = &uc->uc_mcontext; - /* RISCVTODO */ + if (mc->mc_flags & _MC_FP_VALID) + memcpy(r, &mc->mc_fpregs, sizeof(*r)); + else + memset(r, 0, sizeof(*r)); } void