From: Kenn H. <ke...@us...> - 2001-01-29 00:58:20
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv27732 Modified Files: setup.c Log Message: Remove a bunch of superfluous #includes. Setup the boot-time memory allocator properly. Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/setup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- setup.c 2001/01/26 00:27:00 1.2 +++ setup.c 2001/01/29 00:58:11 1.3 @@ -9,32 +9,30 @@ * Bootup setup stuff. */ -#include <linux/sched.h> #include <linux/kernel.h> #include <linux/mm.h> -#include <linux/stddef.h> -#include <linux/unistd.h> -#include <linux/ptrace.h> -#include <linux/malloc.h> -#include <linux/user.h> -#include <linux/tty.h> -#include <linux/delay.h> -#include <linux/config.h> -#include <linux/console.h> +#include <linux/bootmem.h> #include <linux/init.h> #include <linux/string.h> -#include <asm/pgtable.h> #include <asm/rpb.h> +#include <asm/page.h> #define COMMAND_LINE_SIZE 256 static char command_line[COMMAND_LINE_SIZE]; char saved_command_line[COMMAND_LINE_SIZE]; -void __init -setup_arch(char **cmdline_p) +/* Defined in arch/vax/mm/init.c */ +extern void paging_init(void); + +/* Linker will put this at the end of the kernel image */ +extern char _end; + +void __init setup_arch(char **cmdline_p) { + unsigned long bootmap_size; + /* * Locate the command line. - Don't have one yet... */ @@ -43,6 +41,28 @@ /* Get the SID */ vax_cpu.sid = __mfpr(PR_SID); + + /* Initialize bootmem */ + + /* We don't have any holes in our physical memory layout, + so we throw everything into the bootmem allocator. + Eventually, we will get smarter and use the bad page lists + provided by the console ROM to map out faulty memory. + This also has the side effect of placing the bootmem bitmap + at the start of physical memory. init_bootmem() also + marks every page as reserved. We have to explicitly free + available memory ourselves. (max_pfn comes from RPB.) */ + bootmap_size = init_bootmem(0, max_pfn); + + /* Available memory is now the region from the end of the + bootmem bitmap to the start of the kernel and from the + end of the SPT to the end of memory */ +printk("calling free_bootmem(%08lx, %08lx)\n", bootmap_size, KERNEL_START_PHYS - bootmap_size); + free_bootmem(bootmap_size, KERNEL_START_PHYS - bootmap_size); +printk("calling free_bootmem(%08lx, %08lx)\n", __pa(SPT_BASE + SPT_SIZE), (max_pfn << PAGE_SHIFT) - __pa(SPT_BASE + SPT_SIZE)); + free_bootmem(__pa(SPT_BASE + SPT_SIZE), (max_pfn << PAGE_SHIFT) - __pa(SPT_BASE + SPT_SIZE)); + + paging_init(); /* Set up the initial PCB. We can refer to current because head.S has already set us up on the kernel stack of task 0. */ |