aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/machine_kexec.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-09-26 10:52:32 +0200
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 10:52:32 +0200
commit2c8c0e6b8d7700a990da8d24eff767f9ca223b96 (patch)
treeb5477ee2558efff235c483d1619ce892db479d18 /arch/x86_64/kernel/machine_kexec.c
parent1a3f239ddf9208f2e52d36fef1c1c4518cbbbabe (diff)
downloadkernel_samsung_espresso10-2c8c0e6b8d7700a990da8d24eff767f9ca223b96.zip
kernel_samsung_espresso10-2c8c0e6b8d7700a990da8d24eff767f9ca223b96.tar.gz
kernel_samsung_espresso10-2c8c0e6b8d7700a990da8d24eff767f9ca223b96.tar.bz2
[PATCH] Convert x86-64 to early param
Instead of hackish manual parsing Requires earlier i386 patchkit, but also fixes i386 early_printk again. I removed some obsolete really early parameters which didn't do anything useful. Also made a few parameters that needed it early (mostly oops printing setup) Also removed one panic check that wasn't visible without early console anyways (the early console is now initialized after that panic) This cleans up a lot of code. Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/machine_kexec.c')
-rw-r--r--arch/x86_64/kernel/machine_kexec.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86_64/kernel/machine_kexec.c
index 106076b..2e94c07 100644
--- a/arch/x86_64/kernel/machine_kexec.c
+++ b/arch/x86_64/kernel/machine_kexec.c
@@ -226,3 +226,31 @@ NORET_TYPE void machine_kexec(struct kimage *image)
rnk = (relocate_new_kernel_t) control_code_buffer;
(*rnk)(page_list, control_code_buffer, image->start, start_pgtable);
}
+
+/* crashkernel=size@addr specifies the location to reserve for
+ * a crash kernel. By reserving this memory we guarantee
+ * that linux never set's it up as a DMA target.
+ * Useful for holding code to do something appropriate
+ * after a kernel panic.
+ */
+static int __init setup_crashkernel(char *arg)
+{
+ unsigned long size, base;
+ char *p;
+ if (!arg)
+ return -EINVAL;
+ size = memparse(arg, &p);
+ if (arg == p)
+ return -EINVAL;
+ if (*p == '@') {
+ base = memparse(p+1, &p);
+ /* FIXME: Do I want a sanity check to validate the
+ * memory range? Yes you do, but it's too early for
+ * e820 -AK */
+ crashk_res.start = base;
+ crashk_res.end = base + size - 1;
+ }
+ return 0;
+}
+early_param("crashkernel", setup_crashkernel);
+