From: Kenn H. <ke...@us...> - 2001-02-21 00:19:33
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv22449 Modified Files: setup.c Log Message: Clarify memory init a bit and remove duplicate code from calls to printk() and free_bootmem() Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/setup.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- setup.c 2001/02/18 16:42:45 1.6 +++ setup.c 2001/02/21 00:20:30 1.7 @@ -56,10 +56,13 @@ void __init setup_arch(char **cmdline_p) { unsigned long bootmap_size; + unsigned long region_start; + unsigned long region_len; /* * Locate the command line. - Don't have one yet... * atp -- have a temporary one. + * Shouldn't we use strcpy here? */ memcpy(command_line, "root=/dev/nfs nfsroot=/tftpboot/vaxroot\0",54); *cmdline_p = command_line; @@ -80,17 +83,26 @@ 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)); + bootmap_size = init_bootmem(0, max_pfn); printk("bootmap size = %8.8x\n", bootmap_size); /* 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)); - + region_start = bootmap_size; + region_len = KERNEL_START_PHYS - bootmap_size; + + printk("calling free_bootmem(start=%08lx, len=%08lx)\n", + region_start, region_len); + free_bootmem(region_start, region_len); + + region_start = __pa(SPT_BASE + SPT_SIZE); + region_len = (max_pfn << PAGE_SHIFT) - __pa(SPT_BASE + SPT_SIZE); + + printk("calling free_bootmem(start=%08lx, len=%08lx)\n", + region_start, region_len); + free_bootmem(region_start, region_len); + paging_init(); /* Set up the initial PCB. We can refer to current because head.S |