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