patch-2.2.7 linux/arch/sparc/kernel/setup.c

Next file: linux/arch/sparc/kernel/sun4d_irq.c
Previous file: linux/arch/sparc/kernel/process.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.6/linux/arch/sparc/kernel/setup.c linux/arch/sparc/kernel/setup.c
@@ -1,4 +1,4 @@
-/*  $Id: setup.c,v 1.103 1998/09/21 05:05:23 jj Exp $
+/*  $Id: setup.c,v 1.105 1999/04/13 14:17:08 jj Exp $
  *  linux/arch/sparc/kernel/setup.c
  *
  *  Copyright (C) 1995  David S. Miller (davem@caip.rutgers.edu)
@@ -271,8 +271,8 @@
 extern unsigned short root_flags;
 extern unsigned short root_dev;
 extern unsigned short ram_flags;
-extern unsigned ramdisk_image;
-extern unsigned ramdisk_size;
+extern unsigned sparc_ramdisk_image;
+extern unsigned sparc_ramdisk_size;
 #define RAMDISK_IMAGE_START_MASK	0x07FF
 #define RAMDISK_PROMPT_FLAG		0x8000
 #define RAMDISK_LOAD_FLAG		0x4000
@@ -285,7 +285,7 @@
 
 struct tt_entry *sparc_ttable;
 
-static struct pt_regs fake_swapper_regs = { 0, 0, 0, 0, { 0, } };
+struct pt_regs fake_swapper_regs = { 0, 0, 0, 0, { 0, } };
 
 static void prom_cons_write(struct console *con, const char *str, unsigned count)
 {
@@ -375,7 +375,7 @@
 		sun4c_probe_vac();
 	load_mmu();
 	total = prom_probe_memory();
-	*memory_start_p = (((unsigned long) &end));
+	*memory_start_p = PAGE_ALIGN(((unsigned long) &end));
 
 	if(!packed) {
 		for(i=0; sp_banks[i].num_bytes != 0; i++) {
@@ -404,10 +404,10 @@
 	rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0);	
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
-	if (ramdisk_image) {
-		initrd_start = ramdisk_image;
+	if (sparc_ramdisk_image) {
+		initrd_start = sparc_ramdisk_image;
 		if (initrd_start < KERNBASE) initrd_start += KERNBASE;
-		initrd_end = initrd_start + ramdisk_size;
+		initrd_end = initrd_start + sparc_ramdisk_size;
 		if (initrd_end > *memory_end_p) {
 			printk(KERN_CRIT "initrd extends beyond end of memory "
 		                 	 "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
@@ -417,6 +417,14 @@
 		if (initrd_start >= *memory_start_p && initrd_start < *memory_start_p + 2 * PAGE_SIZE) {
 			initrd_below_start_ok = 1;
 			*memory_start_p = PAGE_ALIGN (initrd_end);
+		} else if (initrd_start && sparc_ramdisk_image < KERNBASE) {
+			switch (sparc_cpu_model) {
+			case sun4m:
+			case sun4d:
+				initrd_start -= KERNBASE;
+				initrd_end -= KERNBASE;
+				break;
+			}
 		}
 	}
 #endif	

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)