Paul Mundt | e7e0a4b | 2007-11-20 15:48:39 +0900 | [diff] [blame] | 1 | #include <linux/elfcore.h> |
| 2 | #include <linux/sched.h> |
Paul Mundt | 9bbafce | 2008-03-26 19:02:47 +0900 | [diff] [blame] | 3 | #include <asm/fpu.h> |
Paul Mundt | e7e0a4b | 2007-11-20 15:48:39 +0900 | [diff] [blame] | 4 | |
| 5 | /* |
| 6 | * Capture the user space registers if the task is not running (in user space) |
| 7 | */ |
| 8 | int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) |
| 9 | { |
| 10 | struct pt_regs ptregs; |
| 11 | |
| 12 | ptregs = *task_pt_regs(tsk); |
| 13 | elf_core_copy_regs(regs, &ptregs); |
| 14 | |
| 15 | return 1; |
| 16 | } |
| 17 | |
| 18 | int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpu) |
| 19 | { |
| 20 | int fpvalid = 0; |
| 21 | |
| 22 | #if defined(CONFIG_SH_FPU) |
| 23 | fpvalid = !!tsk_used_math(tsk); |
| 24 | if (fpvalid) { |
| 25 | unlazy_fpu(tsk, task_pt_regs(tsk)); |
| 26 | memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); |
| 27 | } |
| 28 | #endif |
| 29 | |
| 30 | return fpvalid; |
| 31 | } |
| 32 | |