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>
This commit is contained in:
Родитель
f225c86750
Коммит
b1ffa25925
|
@ -38,28 +38,10 @@
|
|||
#include <asm/system.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
|
||||
* data and COW.
|
||||
*/
|
||||
static unsigned long empty_bad_page_table;
|
||||
|
||||
static unsigned long empty_bad_page;
|
||||
|
||||
unsigned long empty_zero_page;
|
||||
|
||||
extern unsigned long memory_start;
|
||||
|
@ -77,22 +59,9 @@ void __init paging_init(void)
|
|||
* Make sure start_mem is page aligned, otherwise bootmem and
|
||||
* 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 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);
|
||||
memset((void *)empty_zero_page, 0, PAGE_SIZE);
|
||||
|
||||
|
@ -101,19 +70,8 @@ void __init paging_init(void)
|
|||
*/
|
||||
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;
|
||||
free_area_init(zones_size);
|
||||
}
|
||||
zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
|
||||
free_area_init(zones_size);
|
||||
}
|
||||
|
||||
void __init mem_init(void)
|
||||
|
@ -166,8 +124,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
free_initmem()
|
||||
void free_initmem(void)
|
||||
{
|
||||
#ifdef CONFIG_RAMKERNEL
|
||||
unsigned long addr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче