Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71513
b: refs/heads/master
c: edd8ce6
h: refs/heads/master
i:
  71511: 3ab0245
v: v3
  • Loading branch information
Bernhard Walle authored and Linus Torvalds committed Oct 19, 2007
1 parent b319d0f commit 3337f18
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb3808532eeb1719667356157fac9222ccb2c4ff
refs/heads/master: edd8ce67436851a62f99f1d9707b40ea6a8e5323
54 changes: 27 additions & 27 deletions trunk/arch/powerpc/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,45 +61,39 @@ NORET_TYPE void machine_kexec(struct kimage *image)
for(;;);
}

static int __init early_parse_crashk(char *p)
{
unsigned long size;

if (!p)
return 1;

size = memparse(p, &p);

if (*p == '@')
crashk_res.start = memparse(p + 1, &p);
else
crashk_res.start = KDUMP_KERNELBASE;

crashk_res.end = crashk_res.start + size - 1;

return 0;
}
early_param("crashkernel", early_parse_crashk);

void __init reserve_crashkernel(void)
{
unsigned long size;
unsigned long long crash_size, crash_base;
int ret;

/* this is necessary because of lmb_phys_mem_size() */
lmb_analyze();

/* use common parsing */
ret = parse_crashkernel(boot_command_line, lmb_phys_mem_size(),
&crash_size, &crash_base);
if (ret == 0 && crash_size > 0) {
if (crash_base == 0)
crash_base = KDUMP_KERNELBASE;
crashk_res.start = crash_base;
} else {
/* handle the device tree */
crash_size = crashk_res.end - crashk_res.start + 1;
}

if (crashk_res.start == 0)
if (crash_size == 0)
return;

/* We might have got these values via the command line or the
* device tree, either way sanitise them now. */

size = crashk_res.end - crashk_res.start + 1;

if (crashk_res.start != KDUMP_KERNELBASE)
printk("Crash kernel location must be 0x%x\n",
KDUMP_KERNELBASE);

crashk_res.start = KDUMP_KERNELBASE;
size = PAGE_ALIGN(size);
crashk_res.end = crashk_res.start + size - 1;
crash_size = PAGE_ALIGN(crash_size);
crashk_res.end = crashk_res.start + crash_size - 1;

/* Crash kernel trumps memory limit */
if (memory_limit && memory_limit <= crashk_res.end) {
Expand All @@ -108,7 +102,13 @@ void __init reserve_crashkernel(void)
memory_limit);
}

lmb_reserve(crashk_res.start, size);
printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
"for crashkernel (System RAM: %ldMB)\n",
(unsigned long)(crash_size >> 20),
(unsigned long)(crashk_res.start >> 20),
(unsigned long)(lmb_phys_mem_size() >> 20));

lmb_reserve(crashk_res.start, crash_size);
}

int overlaps_crashkernel(unsigned long start, unsigned long size)
Expand Down

0 comments on commit 3337f18

Please sign in to comment.