aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regset.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-06-01 19:42:40 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2020-07-27 14:24:50 -0400
commitb4e9c9549f62329d2412f899635fddc5212b9cd4 (patch)
tree2d62ec21ef17f93c1d4b4152b4db978c82adc11e /include/linux/regset.h
parentLinux 5.8-rc1 (diff)
downloadlinux-dev-b4e9c9549f62329d2412f899635fddc5212b9cd4.tar.xz
linux-dev-b4e9c9549f62329d2412f899635fddc5212b9cd4.zip
introduction of regset ->get() wrappers, switching ELF coredumps to those
Two new helpers: given a process and regset, dump into a buffer. regset_get() takes a buffer and size, regset_get_alloc() takes size and allocates a buffer. Return value in both cases is the amount of data actually dumped in case of success or -E... on error. In both cases the size is capped by regset->n * regset->size, so ->get() is called with offset 0 and size no more than what regset expects. binfmt_elf.c callers of ->get() are switched to using those; the other caller (copy_regset_to_user()) will need some preparations to switch. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/regset.h')
-rw-r--r--include/linux/regset.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/regset.h b/include/linux/regset.h
index 46d6ae68c455..968a032922d5 100644
--- a/include/linux/regset.h
+++ b/include/linux/regset.h
@@ -353,6 +353,15 @@ static inline int user_regset_copyin_ignore(unsigned int *pos,
return 0;
}
+extern int regset_get(struct task_struct *target,
+ const struct user_regset *regset,
+ unsigned int size, void *data);
+
+extern int regset_get_alloc(struct task_struct *target,
+ const struct user_regset *regset,
+ unsigned int size,
+ void **data);
+
/**
* copy_regset_to_user - fetch a thread's user_regset data into user memory
* @target: thread to be examined