aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mm
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2011-03-28 23:39:47 -0400
committerGreg Ungerer <gerg@uclinux.org>2011-05-23 20:03:51 -0400
commitb1ffa25925c8166003d985b2803854fedcd44604 (patch)
tree873e8350e8c98603bd27b5ae73057ea86e69150c /arch/m68k/mm
parentf225c8675086b60d85264ef824568309163d79f8 (diff)
m68knommu: clean up mm/init_no.c
The memory initialization code for m68knommu has grown a bit crufty, clean it up. . remove unused declaration for die_if_kernel() . remove un-needed declaration of free_initmem() . removed unused definitions of empty_bad_page and empty_bad_page_table . removed unused DEBUG code . make free_initmem() proper prototype Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/mm')
-rw-r--r--arch/m68k/mm/init_no.c51
1 files changed, 4 insertions, 47 deletions
diff --git a/arch/m68k/mm/init_no.c b/arch/m68k/mm/init_no.c
index 8a6653f56bd8..7cbd7bd1f8bc 100644
--- a/arch/m68k/mm/init_no.c
+++ b/arch/m68k/mm/init_no.c
@@ -38,28 +38,10 @@
38#include <asm/system.h> 38#include <asm/system.h>
39#include <asm/machdep.h> 39#include <asm/machdep.h>
40 40
41#undef DEBUG
42
43extern void die_if_kernel(char *,struct pt_regs *,long);
44extern void free_initmem(void);
45
46/* 41/*
47 * BAD_PAGE is the page that is used for page faults when linux
48 * is out-of-memory. Older versions of linux just did a
49 * do_exit(), but using this instead means there is less risk
50 * for a process dying in kernel mode, possibly leaving a inode
51 * unused etc..
52 *
53 * BAD_PAGETABLE is the accompanying page-table: it is initialized
54 * to point to BAD_PAGE entries.
55 *
56 * ZERO_PAGE is a special page that is used for zero-initialized 42 * ZERO_PAGE is a special page that is used for zero-initialized
57 * data and COW. 43 * data and COW.
58 */ 44 */
59static unsigned long empty_bad_page_table;
60
61static unsigned long empty_bad_page;
62
63unsigned long empty_zero_page; 45unsigned long empty_zero_page;
64 46
65extern unsigned long memory_start; 47extern unsigned long memory_start;
@@ -77,22 +59,9 @@ void __init paging_init(void)
77 * Make sure start_mem is page aligned, otherwise bootmem and 59 * Make sure start_mem is page aligned, otherwise bootmem and
78 * page_alloc get different views of the world. 60 * page_alloc get different views of the world.
79 */ 61 */
80#ifdef DEBUG
81 unsigned long start_mem = PAGE_ALIGN(memory_start);
82#endif
83 unsigned long end_mem = memory_end & PAGE_MASK; 62 unsigned long end_mem = memory_end & PAGE_MASK;
63 unsigned long zones_size[MAX_NR_ZONES] = {0, };
84 64
85#ifdef DEBUG
86 printk (KERN_DEBUG "start_mem is %#lx\nvirtual_end is %#lx\n",
87 start_mem, end_mem);
88#endif
89
90 /*
91 * Initialize the bad page table and bad page to point
92 * to a couple of allocated pages.
93 */
94 empty_bad_page_table = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
95 empty_bad_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
96 empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); 65 empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
97 memset((void *)empty_zero_page, 0, PAGE_SIZE); 66 memset((void *)empty_zero_page, 0, PAGE_SIZE);
98 67
@@ -101,19 +70,8 @@ void __init paging_init(void)
101 */ 70 */
102 set_fs (USER_DS); 71 set_fs (USER_DS);
103 72
104#ifdef DEBUG 73 zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
105 printk (KERN_DEBUG "before free_area_init\n"); 74 free_area_init(zones_size);
106
107 printk (KERN_DEBUG "free_area_init -> start_mem is %#lx\nvirtual_end is %#lx\n",
108 start_mem, end_mem);
109#endif
110
111 {
112 unsigned long zones_size[MAX_NR_ZONES] = {0, };
113
114 zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
115 free_area_init(zones_size);
116 }
117} 75}
118 76
119void __init mem_init(void) 77void __init mem_init(void)
@@ -166,8 +124,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
166} 124}
167#endif 125#endif
168 126
169void 127void free_initmem(void)
170free_initmem()
171{ 128{
172#ifdef CONFIG_RAMKERNEL 129#ifdef CONFIG_RAMKERNEL
173 unsigned long addr; 130 unsigned long addr;