Commit b1ffa25925c8166003d985b2803854fedcd44604

Authored by Greg Ungerer
1 parent f225c86750

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>

Showing 1 changed file with 4 additions and 47 deletions Side-by-side Diff

arch/m68k/mm/init_no.c
... ... @@ -38,28 +38,10 @@
38 38 #include <asm/system.h>
39 39 #include <asm/machdep.h>
40 40  
41   -#undef DEBUG
42   -
43   -extern void die_if_kernel(char *,struct pt_regs *,long);
44   -extern 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 42 * ZERO_PAGE is a special page that is used for zero-initialized
57 43 * data and COW.
58 44 */
59   -static unsigned long empty_bad_page_table;
60   -
61   -static unsigned long empty_bad_page;
62   -
63 45 unsigned long empty_zero_page;
64 46  
65 47 extern unsigned long memory_start;
66 48  
67 49  
... ... @@ -77,22 +59,9 @@
77 59 * Make sure start_mem is page aligned, otherwise bootmem and
78 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 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 65 empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
97 66 memset((void *)empty_zero_page, 0, PAGE_SIZE);
98 67  
... ... @@ -101,19 +70,8 @@
101 70 */
102 71 set_fs (USER_DS);
103 72  
104   -#ifdef DEBUG
105   - printk (KERN_DEBUG "before free_area_init\n");
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   - }
  73 + zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
  74 + free_area_init(zones_size);
117 75 }
118 76  
119 77 void __init mem_init(void)
... ... @@ -166,8 +124,7 @@
166 124 }
167 125 #endif
168 126  
169   -void
170   -free_initmem()
  127 +void free_initmem(void)
171 128 {
172 129 #ifdef CONFIG_RAMKERNEL
173 130 unsigned long addr;