Implement pt_fpreg_to_ucontext(), pt_ucontext_to_fpreg().

Sponsored by:	DARPA, AFRL
This commit is contained in:
Ruslan Bukin 2018-08-02 12:24:34 +00:00
parent f00ebc42b5
commit d8af1b6af6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337129

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