Use the size of struct fpreg rather than of the pointer to it when copying

the FPU state.

Reviewed by:	marcel
Approved by:	re (kib)
MFC after:	1 week
This commit is contained in:
Marius Strobl 2011-08-06 17:49:21 +00:00
parent e31fe879a8
commit 21a305d4af
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224684

View file

@ -92,18 +92,21 @@ pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
void
pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc)
{
memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(r));
memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(*r));
}
void
pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
{
memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(r));
memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(*r));
}
void
pt_md_init(void)
{
/* Nothing to do */
}