Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275346
b: refs/heads/master
c: c40dd2f
h: refs/heads/master
v: v3
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Nov 8, 2011
1 parent 5092e61 commit 36bd44c
Show file tree
Hide file tree
Showing 2 changed files with 31 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: 88cf11b4cca8ee0044d0a10ce100d8c0012b2c5e
refs/heads/master: c40dd2f76644016ca7677545fc846ec2470d70a1
30 changes: 30 additions & 0 deletions trunk/arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/suspend.h>
#include <linux/memblock.h>
#include <linux/hugetlb.h>
#include <linux/slab.h>

#include <asm/pgalloc.h>
#include <asm/prom.h>
Expand Down Expand Up @@ -555,3 +556,32 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
book3e_hugetlb_preload(vma->vm_mm, address, *ptep);
#endif
}

/*
* System memory should not be in /proc/iomem but various tools expect it
* (eg kdump).
*/
static int add_system_ram_resources(void)
{
struct memblock_region *reg;

for_each_memblock(memory, reg) {
struct resource *res;
unsigned long base = reg->base;
unsigned long size = reg->size;

res = kzalloc(sizeof(struct resource), GFP_KERNEL);
WARN_ON(!res);

if (res) {
res->name = "System RAM";
res->start = base;
res->end = base + size - 1;
res->flags = IORESOURCE_MEM;
WARN_ON(request_resource(&iomem_resource, res) < 0);
}
}

return 0;
}
subsys_initcall(add_system_ram_resources);

0 comments on commit 36bd44c

Please sign in to comment.