diff options
Diffstat (limited to 'arch/i386/mm')
-rw-r--r-- | arch/i386/mm/init.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index ae436882af7a..23be1b0aafa4 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c | |||
@@ -774,10 +774,11 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) | |||
774 | unsigned long addr; | 774 | unsigned long addr; |
775 | 775 | ||
776 | for (addr = begin; addr < end; addr += PAGE_SIZE) { | 776 | for (addr = begin; addr < end; addr += PAGE_SIZE) { |
777 | ClearPageReserved(virt_to_page(addr)); | 777 | struct page *page = pfn_to_page(addr >> PAGE_SHIFT); |
778 | init_page_count(virt_to_page(addr)); | 778 | ClearPageReserved(page); |
779 | memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE); | 779 | init_page_count(page); |
780 | free_page(addr); | 780 | memset(page_address(page), POISON_FREE_INITMEM, PAGE_SIZE); |
781 | __free_page(page); | ||
781 | totalram_pages++; | 782 | totalram_pages++; |
782 | } | 783 | } |
783 | printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10); | 784 | printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10); |
@@ -786,14 +787,14 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end) | |||
786 | void free_initmem(void) | 787 | void free_initmem(void) |
787 | { | 788 | { |
788 | free_init_pages("unused kernel memory", | 789 | free_init_pages("unused kernel memory", |
789 | (unsigned long)(&__init_begin), | 790 | __pa_symbol(&__init_begin), |
790 | (unsigned long)(&__init_end)); | 791 | __pa_symbol(&__init_end)); |
791 | } | 792 | } |
792 | 793 | ||
793 | #ifdef CONFIG_BLK_DEV_INITRD | 794 | #ifdef CONFIG_BLK_DEV_INITRD |
794 | void free_initrd_mem(unsigned long start, unsigned long end) | 795 | void free_initrd_mem(unsigned long start, unsigned long end) |
795 | { | 796 | { |
796 | free_init_pages("initrd memory", start, end); | 797 | free_init_pages("initrd memory", __pa(start), __pa(end)); |
797 | } | 798 | } |
798 | #endif | 799 | #endif |
799 | 800 | ||