aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/init.c')
-rw-r--r--arch/mips/mm/init.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 0ff9a348b843..ad89c442f299 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -25,6 +25,7 @@
25#include <linux/highmem.h> 25#include <linux/highmem.h>
26#include <linux/swap.h> 26#include <linux/swap.h>
27#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
28#include <linux/pfn.h>
28 29
29#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
30#include <asm/cachectl.h> 31#include <asm/cachectl.h>
@@ -54,7 +55,8 @@ unsigned long empty_zero_page, zero_page_mask;
54 */ 55 */
55unsigned long setup_zero_pages(void) 56unsigned long setup_zero_pages(void)
56{ 57{
57 unsigned long order, size; 58 unsigned int order;
59 unsigned long size;
58 struct page *page; 60 struct page *page;
59 61
60 if (cpu_has_vce) 62 if (cpu_has_vce)
@@ -67,9 +69,9 @@ unsigned long setup_zero_pages(void)
67 panic("Oh boy, that early out of memory?"); 69 panic("Oh boy, that early out of memory?");
68 70
69 page = virt_to_page(empty_zero_page); 71 page = virt_to_page(empty_zero_page);
72 split_page(page, order);
70 while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) { 73 while (page < virt_to_page(empty_zero_page + (PAGE_SIZE << order))) {
71 SetPageReserved(page); 74 SetPageReserved(page);
72 set_page_count(page, 1);
73 page++; 75 page++;
74 } 76 }
75 77
@@ -176,9 +178,6 @@ void __init paging_init(void)
176 free_area_init(zones_size); 178 free_area_init(zones_size);
177} 179}
178 180
179#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT)
180#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
181
182static inline int page_is_ram(unsigned long pagenr) 181static inline int page_is_ram(unsigned long pagenr)
183{ 182{
184 int i; 183 int i;
@@ -244,7 +243,7 @@ void __init mem_init(void)
244#ifdef CONFIG_LIMITED_DMA 243#ifdef CONFIG_LIMITED_DMA
245 set_page_address(page, lowmem_page_address(page)); 244 set_page_address(page, lowmem_page_address(page));
246#endif 245#endif
247 set_page_count(page, 1); 246 init_page_count(page);
248 __free_page(page); 247 __free_page(page);
249 totalhigh_pages++; 248 totalhigh_pages++;
250 } 249 }
@@ -291,7 +290,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
291 290
292 for (; start < end; start += PAGE_SIZE) { 291 for (; start < end; start += PAGE_SIZE) {
293 ClearPageReserved(virt_to_page(start)); 292 ClearPageReserved(virt_to_page(start));
294 set_page_count(virt_to_page(start), 1); 293 init_page_count(virt_to_page(start));
295 free_page(start); 294 free_page(start);
296 totalram_pages++; 295 totalram_pages++;
297 } 296 }
@@ -314,7 +313,7 @@ void free_initmem(void)
314 page = addr; 313 page = addr;
315#endif 314#endif
316 ClearPageReserved(virt_to_page(page)); 315 ClearPageReserved(virt_to_page(page));
317 set_page_count(virt_to_page(page), 1); 316 init_page_count(virt_to_page(page));
318 free_page(page); 317 free_page(page);
319 totalram_pages++; 318 totalram_pages++;
320 freed += PAGE_SIZE; 319 freed += PAGE_SIZE;