aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/mm/init.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/h8300/mm/init.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/h8300/mm/init.c')
-rw-r--r--arch/h8300/mm/init.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 981e25094b1..7cc3380f250 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -36,7 +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#include <asm/system.h>
40 40
41#undef DEBUG 41#undef DEBUG
42 42
@@ -124,6 +124,7 @@ void __init mem_init(void)
124 int codek = 0, datak = 0, initk = 0; 124 int codek = 0, datak = 0, initk = 0;
125 /* DAVIDM look at setup memory map generically with reserved area */ 125 /* DAVIDM look at setup memory map generically with reserved area */
126 unsigned long tmp; 126 unsigned long tmp;
127 extern char _etext, _stext, _sdata, _ebss, __init_begin, __init_end;
127 extern unsigned long _ramend, _ramstart; 128 extern unsigned long _ramend, _ramstart;
128 unsigned long len = &_ramend - &_ramstart; 129 unsigned long len = &_ramend - &_ramstart;
129 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */ 130 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */
@@ -142,9 +143,9 @@ void __init mem_init(void)
142 /* this will put all memory onto the freelists */ 143 /* this will put all memory onto the freelists */
143 totalram_pages = free_all_bootmem(); 144 totalram_pages = free_all_bootmem();
144 145
145 codek = (_etext - _stext) >> 10; 146 codek = (&_etext - &_stext) >> 10;
146 datak = (__bss_stop - _sdata) >> 10; 147 datak = (&_ebss - &_sdata) >> 10;
147 initk = (__init_begin - __init_end) >> 10; 148 initk = (&__init_begin - &__init_end) >> 10;
148 149
149 tmp = nr_free_pages() << PAGE_SHIFT; 150 tmp = nr_free_pages() << PAGE_SHIFT;
150 printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n", 151 printk(KERN_INFO "Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n",
@@ -178,21 +179,22 @@ free_initmem(void)
178{ 179{
179#ifdef CONFIG_RAMKERNEL 180#ifdef CONFIG_RAMKERNEL
180 unsigned long addr; 181 unsigned long addr;
182 extern char __init_begin, __init_end;
181/* 183/*
182 * the following code should be cool even if these sections 184 * the following code should be cool even if these sections
183 * are not page aligned. 185 * are not page aligned.
184 */ 186 */
185 addr = PAGE_ALIGN((unsigned long)(__init_begin)); 187 addr = PAGE_ALIGN((unsigned long)(&__init_begin));
186 /* next to check that the page we free is not a partial page */ 188 /* next to check that the page we free is not a partial page */
187 for (; addr + PAGE_SIZE < (unsigned long)__init_end; addr +=PAGE_SIZE) { 189 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) {
188 ClearPageReserved(virt_to_page(addr)); 190 ClearPageReserved(virt_to_page(addr));
189 init_page_count(virt_to_page(addr)); 191 init_page_count(virt_to_page(addr));
190 free_page(addr); 192 free_page(addr);
191 totalram_pages++; 193 totalram_pages++;
192 } 194 }
193 printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n", 195 printk(KERN_INFO "Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n",
194 (addr - PAGE_ALIGN((long) __init_begin)) >> 10, 196 (addr - PAGE_ALIGN((long) &__init_begin)) >> 10,
195 (int)(PAGE_ALIGN((unsigned long)__init_begin)), 197 (int)(PAGE_ALIGN((unsigned long)(&__init_begin))),
196 (int)(addr - PAGE_SIZE)); 198 (int)(addr - PAGE_SIZE));
197#endif 199#endif
198} 200}