Implement pt_fpreg_to_ucontext(), pt_ucontext_to_fpreg().

Sponsored by:	DARPA, AFRL
This commit is contained in:
br 2018-08-02 12:24:34 +00:00
parent 3b2642649d
commit 5578c93898

View File

@ -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