Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2018 12:24:34 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
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
Message-ID:  <201808021224.w72COYr3070602@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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