diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-04-26 22:25:57 -0400 |
---|---|---|
committer | Paul Mundt <lethal@hera.kernel.org> | 2007-05-06 22:11:56 -0400 |
commit | 4d5ade5b29c618e97a8988efb6967cb4dd0e2183 (patch) | |
tree | 376d71458747e23e7f5171b9914b0d516cad7c7b /include/asm-sh | |
parent | db62e5bd297d1f325811c5495ad23de36db0fdd4 (diff) |
sh: kdump support.
This adds support for kexec based crash dumps.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/kexec.h | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/include/asm-sh/kexec.h b/include/asm-sh/kexec.h index 9d235af20cdd..da36a7548601 100644 --- a/include/asm-sh/kexec.h +++ b/include/asm-sh/kexec.h | |||
@@ -1,5 +1,8 @@ | |||
1 | #ifndef _SH_KEXEC_H | 1 | #ifndef __ASM_SH_KEXEC_H |
2 | #define _SH_KEXEC_H | 2 | #define __ASM_SH_KEXEC_H |
3 | |||
4 | #include <asm/ptrace.h> | ||
5 | #include <asm/string.h> | ||
3 | 6 | ||
4 | /* | 7 | /* |
5 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. | 8 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. |
@@ -25,8 +28,37 @@ | |||
25 | 28 | ||
26 | #define MAX_NOTE_BYTES 1024 | 29 | #define MAX_NOTE_BYTES 1024 |
27 | 30 | ||
28 | /* Provide a dummy definition to avoid build failures. */ | ||
29 | static inline void crash_setup_regs(struct pt_regs *newregs, | 31 | static inline void crash_setup_regs(struct pt_regs *newregs, |
30 | struct pt_regs *oldregs) { } | 32 | struct pt_regs *oldregs) |
33 | { | ||
34 | if (oldregs) | ||
35 | memcpy(newregs, oldregs, sizeof(*newregs)); | ||
36 | else { | ||
37 | __asm__ __volatile__ ("mov r0, %0" : "=r" (newregs->regs[0])); | ||
38 | __asm__ __volatile__ ("mov r1, %0" : "=r" (newregs->regs[1])); | ||
39 | __asm__ __volatile__ ("mov r2, %0" : "=r" (newregs->regs[2])); | ||
40 | __asm__ __volatile__ ("mov r3, %0" : "=r" (newregs->regs[3])); | ||
41 | __asm__ __volatile__ ("mov r4, %0" : "=r" (newregs->regs[4])); | ||
42 | __asm__ __volatile__ ("mov r5, %0" : "=r" (newregs->regs[5])); | ||
43 | __asm__ __volatile__ ("mov r6, %0" : "=r" (newregs->regs[6])); | ||
44 | __asm__ __volatile__ ("mov r7, %0" : "=r" (newregs->regs[7])); | ||
45 | __asm__ __volatile__ ("mov r8, %0" : "=r" (newregs->regs[8])); | ||
46 | __asm__ __volatile__ ("mov r9, %0" : "=r" (newregs->regs[9])); | ||
47 | __asm__ __volatile__ ("mov r10, %0" : "=r" (newregs->regs[10])); | ||
48 | __asm__ __volatile__ ("mov r11, %0" : "=r" (newregs->regs[11])); | ||
49 | __asm__ __volatile__ ("mov r12, %0" : "=r" (newregs->regs[12])); | ||
50 | __asm__ __volatile__ ("mov r13, %0" : "=r" (newregs->regs[13])); | ||
51 | __asm__ __volatile__ ("mov r14, %0" : "=r" (newregs->regs[14])); | ||
52 | __asm__ __volatile__ ("mov r15, %0" : "=r" (newregs->regs[15])); | ||
53 | |||
54 | __asm__ __volatile__ ("sts pr, %0" : "=r" (newregs->pr)); | ||
55 | __asm__ __volatile__ ("sts macl, %0" : "=r" (newregs->macl)); | ||
56 | __asm__ __volatile__ ("sts mach, %0" : "=r" (newregs->mach)); | ||
57 | |||
58 | __asm__ __volatile__ ("stc gbr, %0" : "=r" (newregs->gbr)); | ||
59 | __asm__ __volatile__ ("stc sr, %0" : "=r" (newregs->sr)); | ||
31 | 60 | ||
32 | #endif /* _SH_KEXEC_H */ | 61 | newregs->pc = (unsigned long)current_text_addr(); |
62 | } | ||
63 | } | ||
64 | #endif /* __ASM_SH_KEXEC_H */ | ||