svn commit: r337129 - head/lib/libthread_db/arch/riscv

Ruslan Bukin br at FreeBSD.org
Thu Aug 2 12:24:35 UTC 2018


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


More information about the svn-src-head mailing list