diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-10-09 05:42:55 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-10-19 22:38:40 -0400 |
commit | 4aeaa223433355a281559033f1e7600bfd73238e (patch) | |
tree | fd8041c536da005a99ba3a094b43de09f27f0f88 /arch/sh | |
parent | a30c89ad41099f58922e0941e346e7c4371655b9 (diff) |
sh: add dynamic crash base address support
Add support for dynamic crash kernel base address.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/setup.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 5767f0a84cd7..e7152cc6930e 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -147,6 +147,7 @@ static void __init reserve_crashkernel(void) | |||
147 | { | 147 | { |
148 | unsigned long long free_mem; | 148 | unsigned long long free_mem; |
149 | unsigned long long crash_size, crash_base; | 149 | unsigned long long crash_size, crash_base; |
150 | void *vp; | ||
150 | int ret; | 151 | int ret; |
151 | 152 | ||
152 | free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; | 153 | free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; |
@@ -155,12 +156,14 @@ static void __init reserve_crashkernel(void) | |||
155 | &crash_size, &crash_base); | 156 | &crash_size, &crash_base); |
156 | if (ret == 0 && crash_size) { | 157 | if (ret == 0 && crash_size) { |
157 | if (crash_base <= 0) { | 158 | if (crash_base <= 0) { |
158 | printk(KERN_INFO "crashkernel reservation failed - " | 159 | vp = alloc_bootmem_nopanic(crash_size); |
159 | "you have to specify a base address\n"); | 160 | if (!vp) { |
160 | return; | 161 | printk(KERN_INFO "crashkernel allocation " |
161 | } | 162 | "failed\n"); |
162 | 163 | return; | |
163 | if (reserve_bootmem(crash_base, crash_size, | 164 | } |
165 | crash_base = __pa(vp); | ||
166 | } else if (reserve_bootmem(crash_base, crash_size, | ||
164 | BOOTMEM_EXCLUSIVE) < 0) { | 167 | BOOTMEM_EXCLUSIVE) < 0) { |
165 | printk(KERN_INFO "crashkernel reservation failed - " | 168 | printk(KERN_INFO "crashkernel reservation failed - " |
166 | "memory is in use\n"); | 169 | "memory is in use\n"); |