diff options
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/alternative.c | 4 | ||||
-rw-r--r-- | arch/i386/mm/init.c | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c index 426f59b0106b..a27c8d347364 100644 --- a/arch/i386/kernel/alternative.c +++ b/arch/i386/kernel/alternative.c | |||
@@ -402,8 +402,8 @@ void __init alternative_instructions(void) | |||
402 | _text, _etext); | 402 | _text, _etext); |
403 | } | 403 | } |
404 | free_init_pages("SMP alternatives", | 404 | free_init_pages("SMP alternatives", |
405 | (unsigned long)__smp_alt_begin, | 405 | __pa_symbol(&__smp_alt_begin), |
406 | (unsigned long)__smp_alt_end); | 406 | __pa_symbol(&__smp_alt_end)); |
407 | } else { | 407 | } else { |
408 | alternatives_smp_save(__smp_alt_instructions, | 408 | alternatives_smp_save(__smp_alt_instructions, |
409 | __smp_alt_instructions_end); | 409 | __smp_alt_instructions_end); |
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 | ||