aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/machine_kexec.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-04-26 22:25:57 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-05-06 22:11:56 -0400
commit4d5ade5b29c618e97a8988efb6967cb4dd0e2183 (patch)
tree376d71458747e23e7f5171b9914b0d516cad7c7b /arch/sh/kernel/machine_kexec.c
parentdb62e5bd297d1f325811c5495ad23de36db0fdd4 (diff)
sh: kdump support.
This adds support for kexec based crash dumps. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/machine_kexec.c')
-rw-r--r--arch/sh/kernel/machine_kexec.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 08587cdb64d6..790ed69b8666 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -59,13 +59,13 @@ static void kexec_info(struct kimage *image)
59 printk(" segment[%d]: 0x%08x - 0x%08x (0x%08x)\n", 59 printk(" segment[%d]: 0x%08x - 0x%08x (0x%08x)\n",
60 i, 60 i,
61 (unsigned int)image->segment[i].mem, 61 (unsigned int)image->segment[i].mem,
62 (unsigned int)image->segment[i].mem + image->segment[i].memsz, 62 (unsigned int)image->segment[i].mem +
63 image->segment[i].memsz,
63 (unsigned int)image->segment[i].memsz); 64 (unsigned int)image->segment[i].memsz);
64 } 65 }
65 printk(" start : 0x%08x\n\n", (unsigned int)image->start); 66 printk(" start : 0x%08x\n\n", (unsigned int)image->start);
66} 67}
67 68
68
69/* 69/*
70 * Do not allocate memory (or fail in any way) in machine_kexec(). 70 * Do not allocate memory (or fail in any way) in machine_kexec().
71 * We are past the point of no return, committed to rebooting now. 71 * We are past the point of no return, committed to rebooting now.
@@ -101,6 +101,27 @@ NORET_TYPE void machine_kexec(struct kimage *image)
101 101
102 /* now call it */ 102 /* now call it */
103 rnk = (relocate_new_kernel_t) reboot_code_buffer; 103 rnk = (relocate_new_kernel_t) reboot_code_buffer;
104 (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); 104 (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg);
105} 105}
106 106
107/* crashkernel=size@addr specifies the location to reserve for
108 * a crash kernel. By reserving this memory we guarantee
109 * that linux never sets it up as a DMA target.
110 * Useful for holding code to do something appropriate
111 * after a kernel panic.
112 */
113static int __init parse_crashkernel(char *arg)
114{
115 unsigned long size, base;
116 size = memparse(arg, &arg);
117 if (*arg == '@') {
118 base = memparse(arg+1, &arg);
119 /* FIXME: Do I want a sanity check
120 * to validate the memory range?
121 */
122 crashk_res.start = base;
123 crashk_res.end = base + size - 1;
124 }
125 return 0;
126}
127early_param("crashkernel", parse_crashkernel);