diff options
author | Mika Westerberg <mika.westerberg@iki.fi> | 2010-05-10 04:22:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-09 10:00:51 -0400 |
commit | 24b776bfb6396fded148167643ffaf8eb3f782b1 (patch) | |
tree | 60a770cc8eaf73988094e4e6b0fc4bbaa0641bd2 /arch/arm/include | |
parent | 3c57fb43c8fcbe46541d3a0274f0b4c802c68927 (diff) |
ARM: 6117/1: kdump: implement crash_setup_regs()
Implement machine specific function crash_setup_regs() which is
responsible for storing machine state when crash occured.
Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/kexec.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/arch/arm/include/asm/kexec.h b/arch/arm/include/asm/kexec.h index df15a0dc228e..8ec9ef5c3c7b 100644 --- a/arch/arm/include/asm/kexec.h +++ b/arch/arm/include/asm/kexec.h | |||
@@ -19,10 +19,26 @@ | |||
19 | 19 | ||
20 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
21 | 21 | ||
22 | struct kimage; | 22 | /** |
23 | /* Provide a dummy definition to avoid build failures. */ | 23 | * crash_setup_regs() - save registers for the panic kernel |
24 | * @newregs: registers are saved here | ||
25 | * @oldregs: registers to be saved (may be %NULL) | ||
26 | * | ||
27 | * Function copies machine registers from @oldregs to @newregs. If @oldregs is | ||
28 | * %NULL then current registers are stored there. | ||
29 | */ | ||
24 | static inline void crash_setup_regs(struct pt_regs *newregs, | 30 | static inline void crash_setup_regs(struct pt_regs *newregs, |
25 | struct pt_regs *oldregs) { } | 31 | struct pt_regs *oldregs) |
32 | { | ||
33 | if (oldregs) { | ||
34 | memcpy(newregs, oldregs, sizeof(*newregs)); | ||
35 | } else { | ||
36 | __asm__ __volatile__ ("stmia %0, {r0 - r15}" | ||
37 | : : "r" (&newregs->ARM_r0)); | ||
38 | __asm__ __volatile__ ("mrs %0, cpsr" | ||
39 | : "=r" (newregs->ARM_cpsr)); | ||
40 | } | ||
41 | } | ||
26 | 42 | ||
27 | #endif /* __ASSEMBLY__ */ | 43 | #endif /* __ASSEMBLY__ */ |
28 | 44 | ||