Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229293
b: refs/heads/master
c: d72e063
h: refs/heads/master
i:
  229291: a134819
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Nov 29, 2010
1 parent ce34ecd commit e4f4825
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64ff31287693c1f325cb9cb049569c1611438ef1
refs/heads/master: d72e063bb32c06c6c1cec14f6857b7c37ba62d7a
33 changes: 33 additions & 0 deletions trunk/arch/powerpc/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <asm/prom.h>
#include <asm/firmware.h>
#include <asm/uaccess.h>
#include <asm/rtas.h>

#ifdef DEBUG
#include <asm/udbg.h>
Expand Down Expand Up @@ -141,3 +142,35 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,

return csize;
}

#ifdef CONFIG_PPC_RTAS
/*
* The crashkernel region will almost always overlap the RTAS region, so
* we have to be careful when shrinking the crashkernel region.
*/
void crash_free_reserved_phys_range(unsigned long begin, unsigned long end)
{
unsigned long addr;
const u32 *basep, *sizep;
unsigned int rtas_start = 0, rtas_end = 0;

basep = of_get_property(rtas.dev, "linux,rtas-base", NULL);
sizep = of_get_property(rtas.dev, "rtas-size", NULL);

if (basep && sizep) {
rtas_start = *basep;
rtas_end = *basep + *sizep;
}

for (addr = begin; addr < end; addr += PAGE_SIZE) {
/* Does this page overlap with the RTAS region? */
if (addr <= rtas_end && ((addr + PAGE_SIZE) > rtas_start))
continue;

ClearPageReserved(pfn_to_page(addr >> PAGE_SHIFT));
init_page_count(pfn_to_page(addr >> PAGE_SHIFT));
free_page((unsigned long)__va(addr));
totalram_pages++;
}
}
#endif

0 comments on commit e4f4825

Please sign in to comment.