summaryrefslogtreecommitdiff
path: root/arch/sh/kernel/dump_task.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-11-20 15:48:39 +0900
committerPaul Mundt <lethal@linux-sh.org>2008-01-28 13:18:49 +0900
commite7e0a4b54a7f225f770d313f9e042f83ece57a35 (patch)
tree1aab00ea2f20226cf905d28970c3e6a629b21198 /arch/sh/kernel/dump_task.c
parenta7aa92d1b499a3ad67b36137445ecb1411a4533b (diff)
sh: Share the ELF dump_task interfaces.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/dump_task.c')
-rw-r--r--arch/sh/kernel/dump_task.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/sh/kernel/dump_task.c b/arch/sh/kernel/dump_task.c
new file mode 100644
index 000000000000..4a8a4083ff0b
--- /dev/null
+++ b/arch/sh/kernel/dump_task.c
@@ -0,0 +1,31 @@
+#include <linux/elfcore.h>
+#include <linux/sched.h>
+
+/*
+ * Capture the user space registers if the task is not running (in user space)
+ */
+int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
+{
+ struct pt_regs ptregs;
+
+ ptregs = *task_pt_regs(tsk);
+ elf_core_copy_regs(regs, &ptregs);
+
+ return 1;
+}
+
+int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpu)
+{
+ int fpvalid = 0;
+
+#if defined(CONFIG_SH_FPU)
+ fpvalid = !!tsk_used_math(tsk);
+ if (fpvalid) {
+ unlazy_fpu(tsk, task_pt_regs(tsk));
+ memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu));
+ }
+#endif
+
+ return fpvalid;
+}
+