diff options
| author | Ruslan Bukin <br@FreeBSD.org> | 2018-08-02 12:24:34 +0000 |
|---|---|---|
| committer | Ruslan Bukin <br@FreeBSD.org> | 2018-08-02 12:24:34 +0000 |
| commit | d8af1b6af6e24dad16e812c9ccd7c6f0699dbd27 (patch) | |
| tree | 748fd789e3b83ab6a024ab65128c9f0026abd21b | |
| parent | f00ebc42b5a9be4a17611290c422c15bac10641c (diff) | |
Notes
| -rw-r--r-- | lib/libthread_db/arch/riscv/libpthread_md.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libthread_db/arch/riscv/libpthread_md.c b/lib/libthread_db/arch/riscv/libpthread_md.c index 31b72ce8fa306..0ac211ac6e5f4 100644 --- a/lib/libthread_db/arch/riscv/libpthread_md.c +++ b/lib/libthread_db/arch/riscv/libpthread_md.c @@ -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 |
