aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/mm/init.c')
-rw-r--r--arch/sparc/mm/init.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index e103f1bb3777..677c1e187a23 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -23,6 +23,7 @@
23#include <linux/highmem.h> 23#include <linux/highmem.h>
24#include <linux/bootmem.h> 24#include <linux/bootmem.h>
25#include <linux/pagemap.h> 25#include <linux/pagemap.h>
26#include <linux/poison.h>
26 27
27#include <asm/system.h> 28#include <asm/system.h>
28#include <asm/vac-ops.h> 29#include <asm/vac-ops.h>
@@ -480,6 +481,7 @@ void free_initmem (void)
480 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 481 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
481 struct page *p; 482 struct page *p;
482 483
484 memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
483 p = virt_to_page(addr); 485 p = virt_to_page(addr);
484 486
485 ClearPageReserved(p); 487 ClearPageReserved(p);
@@ -488,20 +490,26 @@ void free_initmem (void)
488 totalram_pages++; 490 totalram_pages++;
489 num_physpages++; 491 num_physpages++;
490 } 492 }
491 printk (KERN_INFO "Freeing unused kernel memory: %dk freed\n", (&__init_end - &__init_begin) >> 10); 493 printk(KERN_INFO "Freeing unused kernel memory: %dk freed\n",
494 (&__init_end - &__init_begin) >> 10);
492} 495}
493 496
494#ifdef CONFIG_BLK_DEV_INITRD 497#ifdef CONFIG_BLK_DEV_INITRD
495void free_initrd_mem(unsigned long start, unsigned long end) 498void free_initrd_mem(unsigned long start, unsigned long end)
496{ 499{
497 if (start < end) 500 if (start < end)
498 printk (KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10); 501 printk(KERN_INFO "Freeing initrd memory: %ldk freed\n",
502 (end - start) >> 10);
499 for (; start < end; start += PAGE_SIZE) { 503 for (; start < end; start += PAGE_SIZE) {
500 struct page *p = virt_to_page(start); 504 struct page *p;
505
506 memset((void *)start, POISON_FREE_INITMEM, PAGE_SIZE);
507 p = virt_to_page(start);
501 508
502 ClearPageReserved(p); 509 ClearPageReserved(p);
503 init_page_count(p); 510 init_page_count(p);
504 __free_page(p); 511 __free_page(p);
512 totalram_pages++;
505 num_physpages++; 513 num_physpages++;
506 } 514 }
507} 515}