diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-11-20 01:48:39 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:18:49 -0500 |
commit | e7e0a4b54a7f225f770d313f9e042f83ece57a35 (patch) | |
tree | 1aab00ea2f20226cf905d28970c3e6a629b21198 /arch | |
parent | a7aa92d1b499a3ad67b36137445ecb1411a4533b (diff) |
sh: Share the ELF dump_task interfaces.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/Makefile_32 | 1 | ||||
-rw-r--r-- | arch/sh/kernel/Makefile_64 | 1 | ||||
-rw-r--r-- | arch/sh/kernel/dump_task.c | 31 | ||||
-rw-r--r-- | arch/sh/kernel/process_32.c | 28 |
4 files changed, 33 insertions, 28 deletions
diff --git a/arch/sh/kernel/Makefile_32 b/arch/sh/kernel/Makefile_32 index 5c7fa594d6d1..17216f5e7c93 100644 --- a/arch/sh/kernel/Makefile_32 +++ b/arch/sh/kernel/Makefile_32 | |||
@@ -21,5 +21,6 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | |||
21 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 21 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
22 | obj-$(CONFIG_PM) += pm.o | 22 | obj-$(CONFIG_PM) += pm.o |
23 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 23 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
24 | obj-$(CONFIG_BINFMT_ELF) += dump_task.o | ||
24 | 25 | ||
25 | EXTRA_CFLAGS += -Werror | 26 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/sh/kernel/Makefile_64 b/arch/sh/kernel/Makefile_64 index 585b6a11d3f6..1211e864ef12 100644 --- a/arch/sh/kernel/Makefile_64 +++ b/arch/sh/kernel/Makefile_64 | |||
@@ -17,5 +17,6 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | |||
17 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 17 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
18 | obj-$(CONFIG_PM) += pm.o | 18 | obj-$(CONFIG_PM) += pm.o |
19 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 19 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
20 | obj-$(CONFIG_BINFMT_ELF) += dump_task.o | ||
20 | 21 | ||
21 | EXTRA_CFLAGS += -Werror | 22 | EXTRA_CFLAGS += -Werror |
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 @@ | |||
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 | |||
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index 6d7f2b07e491..c9291f462311 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -230,34 +230,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
230 | return fpvalid; | 230 | return fpvalid; |
231 | } | 231 | } |
232 | 232 | ||
233 | /* | ||
234 | * Capture the user space registers if the task is not running (in user space) | ||
235 | */ | ||
236 | int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | ||
237 | { | ||
238 | struct pt_regs ptregs; | ||
239 | |||
240 | ptregs = *task_pt_regs(tsk); | ||
241 | elf_core_copy_regs(regs, &ptregs); | ||
242 | |||
243 | return 1; | ||
244 | } | ||
245 | |||
246 | int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpu) | ||
247 | { | ||
248 | int fpvalid = 0; | ||
249 | |||
250 | #if defined(CONFIG_SH_FPU) | ||
251 | fpvalid = !!tsk_used_math(tsk); | ||
252 | if (fpvalid) { | ||
253 | unlazy_fpu(tsk, task_pt_regs(tsk)); | ||
254 | memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu)); | ||
255 | } | ||
256 | #endif | ||
257 | |||
258 | return fpvalid; | ||
259 | } | ||
260 | |||
261 | asmlinkage void ret_from_fork(void); | 233 | asmlinkage void ret_from_fork(void); |
262 | 234 | ||
263 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | 235 | int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, |