diff options
author | Bernhard Walle <bwalle@suse.de> | 2007-10-19 02:41:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:51 -0400 |
commit | 7d7712a385d5b0a6f921dbd9b66ad3aaed387b5e (patch) | |
tree | fda23444fee6f53a7c5cb887aad547a10cbdf855 | |
parent | edd8ce67436851a62f99f1d9707b40ea6a8e5323 (diff) |
Use extended crashkernel command line on sh
This patch removes the crashkernel parsing from arch/sh/kernel/machine_kexec.c
and calls the generic function, introduced in the generic patch, in
setup_bootmem_allocator().
This is necessary because the amount of System RAM must be known in this
function now because of the new syntax.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Acked-by: Paul Mundt <lethal@linux-sh.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>
-rw-r--r-- | arch/sh/kernel/machine_kexec.c | 21 | ||||
-rw-r--r-- | arch/sh/kernel/setup.c | 38 |
2 files changed, 33 insertions, 26 deletions
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index 790ed69b8666..5c17de51987e 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c | |||
@@ -104,24 +104,3 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
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 | */ | ||
113 | static 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 | } | ||
127 | early_param("crashkernel", parse_crashkernel); | ||
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index b3027a6775b9..b749403f6b38 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -128,6 +128,37 @@ static void __init register_bootmem_low_pages(void) | |||
128 | free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages)); | 128 | free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages)); |
129 | } | 129 | } |
130 | 130 | ||
131 | #ifdef CONFIG_KEXEC | ||
132 | static void __init reserve_crashkernel(void) | ||
133 | { | ||
134 | unsigned long long free_mem; | ||
135 | unsigned long long crash_size, crash_base; | ||
136 | int ret; | ||
137 | |||
138 | free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; | ||
139 | |||
140 | ret = parse_crashkernel(boot_command_line, free_mem, | ||
141 | &crash_size, &crash_base); | ||
142 | if (ret == 0 && crash_size) { | ||
143 | if (crash_base > 0) { | ||
144 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
145 | "for crashkernel (System RAM: %ldMB)\n", | ||
146 | (unsigned long)(crash_size >> 20), | ||
147 | (unsigned long)(crash_base >> 20), | ||
148 | (unsigned long)(free_mem >> 20)); | ||
149 | crashk_res.start = crash_base; | ||
150 | crashk_res.end = crash_base + crash_size - 1; | ||
151 | reserve_bootmem(crash_base, crash_size); | ||
152 | } else | ||
153 | printk(KERN_INFO "crashkernel reservation failed - " | ||
154 | "you have to specify a base address\n"); | ||
155 | } | ||
156 | } | ||
157 | #else | ||
158 | static inline void __init reserve_crashkernel(void) | ||
159 | {} | ||
160 | #endif | ||
161 | |||
131 | void __init setup_bootmem_allocator(unsigned long free_pfn) | 162 | void __init setup_bootmem_allocator(unsigned long free_pfn) |
132 | { | 163 | { |
133 | unsigned long bootmap_size; | 164 | unsigned long bootmap_size; |
@@ -189,11 +220,8 @@ void __init setup_bootmem_allocator(unsigned long free_pfn) | |||
189 | } | 220 | } |
190 | } | 221 | } |
191 | #endif | 222 | #endif |
192 | #ifdef CONFIG_KEXEC | 223 | |
193 | if (crashk_res.start != crashk_res.end) | 224 | reserve_crashkernel(); |
194 | reserve_bootmem(crashk_res.start, | ||
195 | crashk_res.end - crashk_res.start + 1); | ||
196 | #endif | ||
197 | } | 225 | } |
198 | 226 | ||
199 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 227 | #ifndef CONFIG_NEED_MULTIPLE_NODES |