Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182598
b: refs/heads/master
c: ff7fbc7
h: refs/heads/master
v: v3
  • Loading branch information
Suresh Siddha authored and H. Peter Anvin committed Feb 23, 2010
1 parent 86e94da commit bec37d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6a0dd7ec6fb2d4927979ed4dc562fc5c122d826
refs/heads/master: ff7fbc72e0c3ef7e94a27a3a918fd09ec9a30204
30 changes: 7 additions & 23 deletions trunk/arch/x86/kernel/i387.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,34 +243,18 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
return ret;

/*
* First copy the fxsave bytes 0..463.
* Copy the 48bytes defined by the software first into the xstate
* memory layout in the thread struct, so that we can copy the entire
* xstateregs to the user using one user_regset_copyout().
*/
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
&target->thread.xstate->xsave, 0,
offsetof(struct user_xstateregs,
i387.xstate_fx_sw));
if (ret)
return ret;

/*
* Copy the 48bytes defined by software.
*/
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
xstate_fx_sw_bytes,
offsetof(struct user_xstateregs,
i387.xstate_fx_sw),
offsetof(struct user_xstateregs,
xsave_hdr));
if (ret)
return ret;
memcpy(&target->thread.xstate->fxsave.sw_reserved,
xstate_fx_sw_bytes, sizeof(xstate_fx_sw_bytes));

/*
* Copy the rest of xstate memory layout.
* Copy the xstate memory layout.
*/
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
&target->thread.xstate->xsave.xsave_hdr,
offsetof(struct user_xstateregs,
xsave_hdr), -1);
&target->thread.xstate->xsave, 0, -1);
return ret;
}

Expand Down

0 comments on commit bec37d5

Please sign in to comment.