diff options
Diffstat (limited to 'arch/c6x/mm/init.c')
-rw-r--r-- | arch/c6x/mm/init.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c index 89395f09648a..a9fcd89b251b 100644 --- a/arch/c6x/mm/init.c +++ b/arch/c6x/mm/init.c | |||
@@ -77,37 +77,11 @@ void __init mem_init(void) | |||
77 | #ifdef CONFIG_BLK_DEV_INITRD | 77 | #ifdef CONFIG_BLK_DEV_INITRD |
78 | void __init free_initrd_mem(unsigned long start, unsigned long end) | 78 | void __init free_initrd_mem(unsigned long start, unsigned long end) |
79 | { | 79 | { |
80 | int pages = 0; | 80 | free_reserved_area(start, end, 0, "initrd"); |
81 | for (; start < end; start += PAGE_SIZE) { | ||
82 | ClearPageReserved(virt_to_page(start)); | ||
83 | init_page_count(virt_to_page(start)); | ||
84 | free_page(start); | ||
85 | totalram_pages++; | ||
86 | pages++; | ||
87 | } | ||
88 | printk(KERN_INFO "Freeing initrd memory: %luk freed\n", | ||
89 | (pages * PAGE_SIZE) >> 10); | ||
90 | } | 81 | } |
91 | #endif | 82 | #endif |
92 | 83 | ||
93 | void __init free_initmem(void) | 84 | void __init free_initmem(void) |
94 | { | 85 | { |
95 | unsigned long addr; | 86 | free_initmem_default(0); |
96 | |||
97 | /* | ||
98 | * The following code should be cool even if these sections | ||
99 | * are not page aligned. | ||
100 | */ | ||
101 | addr = PAGE_ALIGN((unsigned long)(__init_begin)); | ||
102 | |||
103 | /* next to check that the page we free is not a partial page */ | ||
104 | for (; addr + PAGE_SIZE < (unsigned long)(__init_end); | ||
105 | addr += PAGE_SIZE) { | ||
106 | ClearPageReserved(virt_to_page(addr)); | ||
107 | init_page_count(virt_to_page(addr)); | ||
108 | free_page(addr); | ||
109 | totalram_pages++; | ||
110 | } | ||
111 | printk(KERN_INFO "Freeing unused kernel memory: %dK freed\n", | ||
112 | (int) ((addr - PAGE_ALIGN((long) &__init_begin)) >> 10)); | ||
113 | } | 87 | } |