aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2011-08-23 00:59:42 -0400
committerGreg Ungerer <gerg@uclinux.org>2011-10-18 00:22:26 -0400
commit9da48c01f5b6a0e32708e3214afe77a10cf0356f (patch)
treebe249a86546962f0616addf5a15b1ca3c0695199
parentc06e9bb427bc8ae74b43a99888da077c20747165 (diff)
m68knommu: use generic section names in mm/init code
We should be including and using sections.h to get at the extern definitions of the linker sections in the m68knommu mm init code. Not defining them locally. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
-rw-r--r--arch/m68k/mm/init_no.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/m68k/mm/init_no.c b/arch/m68k/mm/init_no.c
index 50cd12cf28d9..66512da66f98 100644
--- a/arch/m68k/mm/init_no.c
+++ b/arch/m68k/mm/init_no.c
@@ -32,6 +32,7 @@
32#include <linux/gfp.h> 32#include <linux/gfp.h>
33 33
34#include <asm/setup.h> 34#include <asm/setup.h>
35#include <asm/sections.h>
35#include <asm/segment.h> 36#include <asm/segment.h>
36#include <asm/page.h> 37#include <asm/page.h>
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
@@ -78,7 +79,6 @@ void __init mem_init(void)
78{ 79{
79 int codek = 0, datak = 0, initk = 0; 80 int codek = 0, datak = 0, initk = 0;
80 unsigned long tmp; 81 unsigned long tmp;
81 extern char _etext, _stext, _sdata, _ebss, __init_begin, __init_end;
82 extern unsigned int _ramend, _rambase; 82 extern unsigned int _ramend, _rambase;
83 unsigned long len = _ramend - _rambase; 83 unsigned long len = _ramend - _rambase;
84 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */ 84 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */
@@ -95,9 +95,9 @@ void __init mem_init(void)
95 /* this will put all memory onto the freelists */ 95 /* this will put all memory onto the freelists */
96 totalram_pages = free_all_bootmem(); 96 totalram_pages = free_all_bootmem();
97 97
98 codek = (&_etext - &_stext) >> 10; 98 codek = (_etext - _stext) >> 10;
99 datak = (&_ebss - &_sdata) >> 10; 99 datak = (_ebss - _sdata) >> 10;
100 initk = (&__init_begin - &__init_end) >> 10; 100 initk = (__init_begin - __init_end) >> 10;
101 101
102 tmp = nr_free_pages() << PAGE_SHIFT; 102 tmp = nr_free_pages() << PAGE_SHIFT;
103 printk(KERN_INFO "Memory available: %luk/%luk RAM, (%dk kernel code, %dk data)\n", 103 printk(KERN_INFO "Memory available: %luk/%luk RAM, (%dk kernel code, %dk data)\n",
@@ -129,22 +129,21 @@ void free_initmem(void)
129{ 129{
130#ifdef CONFIG_RAMKERNEL 130#ifdef CONFIG_RAMKERNEL
131 unsigned long addr; 131 unsigned long addr;
132 extern char __init_begin, __init_end;
133 /* 132 /*
134 * The following code should be cool even if these sections 133 * The following code should be cool even if these sections
135 * are not page aligned. 134 * are not page aligned.
136 */ 135 */
137 addr = PAGE_ALIGN((unsigned long)(&__init_begin)); 136 addr = PAGE_ALIGN((unsigned long) __init_begin);
138 /* next to check that the page we free is not a partial page */ 137 /* next to check that the page we free is not a partial page */
139 for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) { 138 for (; addr + PAGE_SIZE < ((unsigned long) __init_end); addr += PAGE_SIZE) {
140 ClearPageReserved(virt_to_page(addr)); 139 ClearPageReserved(virt_to_page(addr));
141 init_page_count(virt_to_page(addr)); 140 init_page_count(virt_to_page(addr));
142 free_page(addr); 141 free_page(addr);
143 totalram_pages++; 142 totalram_pages++;
144 } 143 }
145 pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n", 144 pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n",
146 (addr - PAGE_ALIGN((long) &__init_begin)) >> 10, 145 (addr - PAGE_ALIGN((unsigned long) __init_begin)) >> 10,
147 (int)(PAGE_ALIGN((unsigned long)(&__init_begin))), 146 (int)(PAGE_ALIGN((unsigned long) __init_begin)),
148 (int)(addr - PAGE_SIZE)); 147 (int)(addr - PAGE_SIZE));
149#endif 148#endif
150} 149}