aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh')
-rw-r--r--include/asm-sh/kexec.h42
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. */
29static inline void crash_setup_regs(struct pt_regs *newregs, 31static 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 */