diff options
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r-- | arch/powerpc/mm/mem.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 16da595ff402..2dd6bdd31fe1 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/suspend.h> | 34 | #include <linux/suspend.h> |
35 | #include <linux/memblock.h> | 35 | #include <linux/memblock.h> |
36 | #include <linux/hugetlb.h> | 36 | #include <linux/hugetlb.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | #include <asm/pgalloc.h> | 39 | #include <asm/pgalloc.h> |
39 | #include <asm/prom.h> | 40 | #include <asm/prom.h> |
@@ -555,3 +556,32 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, | |||
555 | book3e_hugetlb_preload(vma->vm_mm, address, *ptep); | 556 | book3e_hugetlb_preload(vma->vm_mm, address, *ptep); |
556 | #endif | 557 | #endif |
557 | } | 558 | } |
559 | |||
560 | /* | ||
561 | * System memory should not be in /proc/iomem but various tools expect it | ||
562 | * (eg kdump). | ||
563 | */ | ||
564 | static int add_system_ram_resources(void) | ||
565 | { | ||
566 | struct memblock_region *reg; | ||
567 | |||
568 | for_each_memblock(memory, reg) { | ||
569 | struct resource *res; | ||
570 | unsigned long base = reg->base; | ||
571 | unsigned long size = reg->size; | ||
572 | |||
573 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); | ||
574 | WARN_ON(!res); | ||
575 | |||
576 | if (res) { | ||
577 | res->name = "System RAM"; | ||
578 | res->start = base; | ||
579 | res->end = base + size - 1; | ||
580 | res->flags = IORESOURCE_MEM; | ||
581 | WARN_ON(request_resource(&iomem_resource, res) < 0); | ||
582 | } | ||
583 | } | ||
584 | |||
585 | return 0; | ||
586 | } | ||
587 | subsys_initcall(add_system_ram_resources); | ||