diff options
author | Bernhard Walle <bwalle@suse.de> | 2007-10-19 02:41:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:51 -0400 |
commit | edd8ce67436851a62f99f1d9707b40ea6a8e5323 (patch) | |
tree | b8bddc4e2ce9fa3c2b1d7e3fc39d5e94634368a6 /arch/powerpc | |
parent | cb3808532eeb1719667356157fac9222ccb2c4ff (diff) |
Use extended crashkernel command line on ppc64
This patch adapts the ppc64 code to use the generic parse_crashkernel()
function introduced in the generic patch of that series.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/machine_kexec.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index e60a0c544d63..c0c8e8c3ced9 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -61,45 +61,39 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
61 | for(;;); | 61 | for(;;); |
62 | } | 62 | } |
63 | 63 | ||
64 | static int __init early_parse_crashk(char *p) | ||
65 | { | ||
66 | unsigned long size; | ||
67 | |||
68 | if (!p) | ||
69 | return 1; | ||
70 | |||
71 | size = memparse(p, &p); | ||
72 | |||
73 | if (*p == '@') | ||
74 | crashk_res.start = memparse(p + 1, &p); | ||
75 | else | ||
76 | crashk_res.start = KDUMP_KERNELBASE; | ||
77 | |||
78 | crashk_res.end = crashk_res.start + size - 1; | ||
79 | |||
80 | return 0; | ||
81 | } | ||
82 | early_param("crashkernel", early_parse_crashk); | ||
83 | |||
84 | void __init reserve_crashkernel(void) | 64 | void __init reserve_crashkernel(void) |
85 | { | 65 | { |
86 | unsigned long size; | 66 | unsigned long long crash_size, crash_base; |
67 | int ret; | ||
68 | |||
69 | /* this is necessary because of lmb_phys_mem_size() */ | ||
70 | lmb_analyze(); | ||
71 | |||
72 | /* use common parsing */ | ||
73 | ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(), | ||
74 | &crash_size, &crash_base); | ||
75 | if (ret == 0 && crash_size > 0) { | ||
76 | if (crash_base == 0) | ||
77 | crash_base = KDUMP_KERNELBASE; | ||
78 | crashk_res.start = crash_base; | ||
79 | } else { | ||
80 | /* handle the device tree */ | ||
81 | crash_size = crashk_res.end - crashk_res.start + 1; | ||
82 | } | ||
87 | 83 | ||
88 | if (crashk_res.start == 0) | 84 | if (crash_size == 0) |
89 | return; | 85 | return; |
90 | 86 | ||
91 | /* We might have got these values via the command line or the | 87 | /* We might have got these values via the command line or the |
92 | * device tree, either way sanitise them now. */ | 88 | * device tree, either way sanitise them now. */ |
93 | 89 | ||
94 | size = crashk_res.end - crashk_res.start + 1; | ||
95 | |||
96 | if (crashk_res.start != KDUMP_KERNELBASE) | 90 | if (crashk_res.start != KDUMP_KERNELBASE) |
97 | printk("Crash kernel location must be 0x%x\n", | 91 | printk("Crash kernel location must be 0x%x\n", |
98 | KDUMP_KERNELBASE); | 92 | KDUMP_KERNELBASE); |
99 | 93 | ||
100 | crashk_res.start = KDUMP_KERNELBASE; | 94 | crashk_res.start = KDUMP_KERNELBASE; |
101 | size = PAGE_ALIGN(size); | 95 | crash_size = PAGE_ALIGN(crash_size); |
102 | crashk_res.end = crashk_res.start + size - 1; | 96 | crashk_res.end = crashk_res.start + crash_size - 1; |
103 | 97 | ||
104 | /* Crash kernel trumps memory limit */ | 98 | /* Crash kernel trumps memory limit */ |
105 | if (memory_limit && memory_limit <= crashk_res.end) { | 99 | if (memory_limit && memory_limit <= crashk_res.end) { |
@@ -108,7 +102,13 @@ void __init reserve_crashkernel(void) | |||
108 | memory_limit); | 102 | memory_limit); |
109 | } | 103 | } |
110 | 104 | ||
111 | lmb_reserve(crashk_res.start, size); | 105 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " |
106 | "for crashkernel (System RAM: %ldMB)\n", | ||
107 | (unsigned long)(crash_size >> 20), | ||
108 | (unsigned long)(crashk_res.start >> 20), | ||
109 | (unsigned long)(lmb_phys_mem_size() >> 20)); | ||
110 | |||
111 | lmb_reserve(crashk_res.start, crash_size); | ||
112 | } | 112 | } |
113 | 113 | ||
114 | int overlaps_crashkernel(unsigned long start, unsigned long size) | 114 | int overlaps_crashkernel(unsigned long start, unsigned long size) |