aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/mm/init.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-07-20 03:42:59 -0400
committerPaul Mundt <lethal@linux-sh.org>2012-07-20 03:42:59 -0400
commit9ff561fdf73493d757bbc74aa58627e1381650fb (patch)
tree4484d230662126b1ac94ea545ca5429c91e0a68b /arch/h8300/mm/init.c
parent7b98cf0cf4e8798b9e7435f966ed0d90a2a925de (diff)
parentfdd85ec3eb8cc1b663678a3efa16ee59a32e0277 (diff)
Merge branch 'common/pinctrl' into sh-latest
Diffstat (limited to 'arch/h8300/mm/init.c')
-rw-r--r--arch/h8300/mm/init.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 973369c32a95..981e25094b1a 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -36,6 +36,7 @@
36#include <asm/segment.h> 36#include <asm/segment.h>
37#include <asm/page.h> 37#include <asm/page.h>
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/sections.h>
39 40
40#undef DEBUG 41#undef DEBUG
41 42
@@ -123,7 +124,6 @@ void __init mem_init(void)
123 int codek = 0, datak = 0, initk = 0; 124 int codek = 0, datak = 0, initk = 0;
124 /* DAVIDM look at setup memory map generically with reserved area */ 125 /* DAVIDM look at setup memory map generically with reserved area */
125 unsigned long tmp; 126 unsigned long tmp;
126 extern char _etext, _stext, _sdata, _ebss, __init_begin, __init_end;
127 extern unsigned long _ramend, _ramstart; 127 extern unsigned long _ramend, _ramstart;
128 unsigned long len = &_ramend - &_ramstart; 128 unsigned long len = &_ramend - &_ramstart;
129 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */ 129 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */
@@ -142,9 +142,9 @@ void __init mem_init(void)
142 /* this will put all memory onto the freelists */ 142 /* this will put all memory onto the freelists */
143 totalram_pages = free_all_bootmem(); 143 totalram_pages = free_all_bootmem();
144 144
145 codek = (&_etext - &_stext) >> 10; 145 codek = (_etext - _stext) >> 10;
146 datak = (&_ebss - &_sdata) >> 10; 146 datak = (__bss_stop - _sdata) >> 10;
147 initk = (&__init_begin - &__init_end) >> 10; 147 initk = (__init_begin - __init_end) >> 10;
148 148
149 tmp = nr_free_pages() << PAGE_SHIFT; 149 tmp = nr_free_pages() << PAGE_SHIFT;
150 printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n", 150 printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n",
@@ -178,22 +178,21 @@ free_initmem(void)
178{ 178{
179#ifdef CONFIG_RAMKERNEL 179#ifdef CONFIG_RAMKERNEL
180 unsigned long addr; 180 unsigned long addr;
181 extern char __init_begin, __init_end;
182/* 181/*
183 * the following code should be cool even if these sections 182 * the following code should be cool even if these sections
184 * are not page aligned. 183 * are not page aligned.
185 */ 184 */
186 addr = PAGE_ALIGN((unsigned long)(&__init_begin)); 185 addr = PAGE_ALIGN((unsigned long)(__init_begin));
187 /* next to check that the page we free is not a partial page */ 186 /* next to check that the page we free is not a partial page */
188 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) { 187 for (; addr + PAGE_SIZE < (unsigned long)__init_end; addr +=PAGE_SIZE) {
189 ClearPageReserved(virt_to_page(addr)); 188 ClearPageReserved(virt_to_page(addr));
190 init_page_count(virt_to_page(addr)); 189 init_page_count(virt_to_page(addr));
191 free_page(addr); 190 free_page(addr);
192 totalram_pages++; 191 totalram_pages++;
193 } 192 }
194 printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n", 193 printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
195 (addr - PAGE_ALIGN((long) &__init_begin)) >> 10, 194 (addr - PAGE_ALIGN((long) __init_begin)) >> 10,
196 (int)(PAGE_ALIGN((unsigned long)(&__init_begin))), 195 (int)(PAGE_ALIGN((unsigned long)__init_begin)),
197 (int)(addr - PAGE_SIZE)); 196 (int)(addr - PAGE_SIZE));
198#endif 197#endif
199} 198}