diff options
author | Jiang Liu <liuj97@gmail.com> | 2013-04-29 18:06:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:30 -0400 |
commit | 32ce012064b3cc89d2081d34a745af598e5e56c5 (patch) | |
tree | 7f38058627aa040a336367ea8cfb76ab7b5fe752 /arch/mn10300/mm | |
parent | 31605922613dfc59402cd6f3a1b019bc2138ff47 (diff) |
mm/mn10300: use common help functions to free reserved pages
Use common help functions to free reserved pages.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mn10300/mm')
-rw-r--r-- | arch/mn10300/mm/init.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/arch/mn10300/mm/init.c b/arch/mn10300/mm/init.c index e57e5bc23562..5a8ace63a6b4 100644 --- a/arch/mn10300/mm/init.c +++ b/arch/mn10300/mm/init.c | |||
@@ -139,30 +139,11 @@ void __init mem_init(void) | |||
139 | } | 139 | } |
140 | 140 | ||
141 | /* | 141 | /* |
142 | * | ||
143 | */ | ||
144 | void free_init_pages(char *what, unsigned long begin, unsigned long end) | ||
145 | { | ||
146 | unsigned long addr; | ||
147 | |||
148 | for (addr = begin; addr < end; addr += PAGE_SIZE) { | ||
149 | ClearPageReserved(virt_to_page(addr)); | ||
150 | init_page_count(virt_to_page(addr)); | ||
151 | memset((void *) addr, 0xcc, PAGE_SIZE); | ||
152 | free_page(addr); | ||
153 | totalram_pages++; | ||
154 | } | ||
155 | printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10); | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | * recycle memory containing stuff only required for initialisation | 142 | * recycle memory containing stuff only required for initialisation |
160 | */ | 143 | */ |
161 | void free_initmem(void) | 144 | void free_initmem(void) |
162 | { | 145 | { |
163 | free_init_pages("unused kernel memory", | 146 | free_initmem_default(POISON_FREE_INITMEM); |
164 | (unsigned long) &__init_begin, | ||
165 | (unsigned long) &__init_end); | ||
166 | } | 147 | } |
167 | 148 | ||
168 | /* | 149 | /* |
@@ -171,6 +152,6 @@ void free_initmem(void) | |||
171 | #ifdef CONFIG_BLK_DEV_INITRD | 152 | #ifdef CONFIG_BLK_DEV_INITRD |
172 | void free_initrd_mem(unsigned long start, unsigned long end) | 153 | void free_initrd_mem(unsigned long start, unsigned long end) |
173 | { | 154 | { |
174 | free_init_pages("initrd memory", start, end); | 155 | free_reserved_area(start, end, POISON_FREE_INITMEM, "initrd"); |
175 | } | 156 | } |
176 | #endif | 157 | #endif |