Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80058
b: refs/heads/master
c: 5bde4d1
h: refs/heads/master
v: v3
  • Loading branch information
Roland McGrath authored and Ingo Molnar committed Jan 30, 2008
1 parent 74f94f7 commit f9eead8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9d36d5d000294a128f7f174fe67623a10e29d61
refs/heads/master: 5bde4d181793be84351bc21c256d8c71cfcd313a
46 changes: 46 additions & 0 deletions trunk/include/linux/regset.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,51 @@ static inline int user_regset_copyin_ignore(unsigned int *pos,
return 0;
}

/**
* copy_regset_to_user - fetch a thread's user_regset data into user memory
* @target: thread to be examined
* @view: &struct user_regset_view describing user thread machine state
* @setno: index in @view->regsets
* @offset: offset into the regset data, in bytes
* @size: amount of data to copy, in bytes
* @data: user-mode pointer to copy into
*/
static inline int copy_regset_to_user(struct task_struct *target,
const struct user_regset_view *view,
unsigned int setno,
unsigned int offset, unsigned int size,
void __user *data)
{
const struct user_regset *regset = &view->regsets[setno];

if (!access_ok(VERIFY_WRITE, data, size))
return -EIO;

return regset->get(target, regset, offset, size, NULL, data);
}

/**
* copy_regset_from_user - store into thread's user_regset data from user memory
* @target: thread to be examined
* @view: &struct user_regset_view describing user thread machine state
* @setno: index in @view->regsets
* @offset: offset into the regset data, in bytes
* @size: amount of data to copy, in bytes
* @data: user-mode pointer to copy from
*/
static inline int copy_regset_from_user(struct task_struct *target,
const struct user_regset_view *view,
unsigned int setno,
unsigned int offset, unsigned int size,
const void __user *data)
{
const struct user_regset *regset = &view->regsets[setno];

if (!access_ok(VERIFY_READ, data, size))
return -EIO;

return regset->set(target, regset, offset, size, NULL, data);
}


#endif /* <linux/regset.h> */

0 comments on commit f9eead8

Please sign in to comment.