Commit b1ffa259 authored by Greg Ungerer's avatar Greg Ungerer

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: default avatarGreg Ungerer <gerg@uclinux.org>
parent f225c867
...@@ -38,28 +38,10 @@ ...@@ -38,28 +38,10 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#undef DEBUG
extern void die_if_kernel(char *,struct pt_regs *,long);
extern void free_initmem(void);
/* /*
* BAD_PAGE is the page that is used for page faults when linux
* is out-of-memory. Older versions of linux just did a
* do_exit(), but using this instead means there is less risk
* for a process dying in kernel mode, possibly leaving a inode
* unused etc..
*
* BAD_PAGETABLE is the accompanying page-table: it is initialized
* to point to BAD_PAGE entries.
*
* ZERO_PAGE is a special page that is used for zero-initialized * ZERO_PAGE is a special page that is used for zero-initialized
* data and COW. * data and COW.
*/ */
static unsigned long empty_bad_page_table;
static unsigned long empty_bad_page;
unsigned long empty_zero_page; unsigned long empty_zero_page;
extern unsigned long memory_start; extern unsigned long memory_start;
...@@ -77,22 +59,9 @@ void __init paging_init(void) ...@@ -77,22 +59,9 @@ void __init paging_init(void)
* Make sure start_mem is page aligned, otherwise bootmem and * Make sure start_mem is page aligned, otherwise bootmem and
* page_alloc get different views of the world. * page_alloc get different views of the world.
*/ */
#ifdef DEBUG
unsigned long start_mem = PAGE_ALIGN(memory_start);
#endif
unsigned long end_mem = memory_end & PAGE_MASK; unsigned long end_mem = memory_end & PAGE_MASK;
unsigned long zones_size[MAX_NR_ZONES] = {0, };
#ifdef DEBUG
printk (KERN_DEBUG "start_mem is %#lx\nvirtual_end is %#lx\n",
start_mem, end_mem);
#endif
/*
* Initialize the bad page table and bad page to point
* to a couple of allocated pages.
*/
empty_bad_page_table = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
empty_bad_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
memset((void *)empty_zero_page, 0, PAGE_SIZE); memset((void *)empty_zero_page, 0, PAGE_SIZE);
...@@ -101,19 +70,8 @@ void __init paging_init(void) ...@@ -101,19 +70,8 @@ void __init paging_init(void)
*/ */
set_fs (USER_DS); set_fs (USER_DS);
#ifdef DEBUG
printk (KERN_DEBUG "before free_area_init\n");
printk (KERN_DEBUG "free_area_init -> start_mem is %#lx\nvirtual_end is %#lx\n",
start_mem, end_mem);
#endif
{
unsigned long zones_size[MAX_NR_ZONES] = {0, };
zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
free_area_init(zones_size); free_area_init(zones_size);
}
} }
void __init mem_init(void) void __init mem_init(void)
...@@ -166,8 +124,7 @@ void free_initrd_mem(unsigned long start, unsigned long end) ...@@ -166,8 +124,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
} }
#endif #endif
void void free_initmem(void)
free_initmem()
{ {
#ifdef CONFIG_RAMKERNEL #ifdef CONFIG_RAMKERNEL
unsigned long addr; unsigned long addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment