Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv22254
Modified Files:
setup.c
Log Message:
align memory regions to 4k boundaries before feeding to free_bootmem.
kernel start and end are not guaranteed to be on 4k pages..
Index: setup.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/setup.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- setup.c 2001/08/20 21:32:36 1.11
+++ setup.c 2001/08/21 20:06:42 1.12
@@ -68,7 +68,7 @@
* atp -- have a temporary one.
* Shouldn't we use strcpy here?
*/
- memcpy(command_line, "root=/dev/nfs nfsroot=/tftpboot/vaxroot rw debug\0",63);
+ memcpy(command_line, "root=/dev/nfs nfsroot=/tftpboot/vaxroot rw debug\0",55);
*cmdline_p = command_line;
/* Save unparsed command line copy for /proc/cmdline */
memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
@@ -92,22 +92,31 @@
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);
+
+#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
+#define PAGEALIGNUP(x) (((x) + PAGE_SIZE-1) & ~(PAGE_SIZE-1))
+#define PAGEALIGNDN(x) ((x) & ~(PAGE_SIZE-1))
+#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
+
+ 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 */
- region_start = bootmap_size;
- region_len = KERNEL_START_PHYS - bootmap_size;
+
+ region_start = PAGEALIGNUP(bootmap_size);
+ region_len = PAGEALIGNDN(KERNEL_START_PHYS) - region_start;
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);
+ region_start = PAGEALIGNUP(__pa(SPT_BASE + SPT_SIZE));
+ region_len = PAGEALIGNDN((max_pfn << PAGE_SHIFT)) - region_start;
printk("calling free_bootmem(start=%08lx, len=%08lx)\n",
region_start, region_len);
|