patch-2.3.22 linux/arch/ppc/kernel/setup.c

Next file: linux/arch/ppc/kernel/traps.c
Previous file: linux/arch/ppc/kernel/residual.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.21/linux/arch/ppc/kernel/setup.c linux/arch/ppc/kernel/setup.c
@@ -1,5 +1,5 @@
 /*
- * $Id: setup.c,v 1.159 1999/09/18 18:40:38 dmalek Exp $
+ * $Id: setup.c,v 1.160 1999/10/08 01:56:38 paulus Exp $
  * Common prep/pmac/chrp boot and setup code.
  */
 
@@ -489,6 +489,28 @@
         m8xx_init(r3, r4, r5, r6, r7);
 #endif
 
+	/* Look for mem= option on command line */
+	if (strstr(cmd_line, "mem=")) {
+		char *p, *q;
+		unsigned long maxmem = 0;
+		extern unsigned long __max_memory;
+
+		for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
+			q = p + 4;
+			if (p > cmd_line && p[-1] != ' ')
+				continue;
+			maxmem = simple_strtoul(q, &q, 0);
+			if (*q == 'k' || *q == 'K') {
+				maxmem <<= 10;
+				++q;
+			} else if (*q == 'm' || *q == 'M') {
+				maxmem <<= 20;
+				++q;
+			}
+		}
+		__max_memory = maxmem;
+	}
+	
 	/* this is for modules since _machine can be a define -- Cort */
 	ppc_md.ppc_machine = _machine;
 
@@ -533,7 +555,7 @@
 	if (strstr(cmd_line, "xmon"))
 		xmon(0);
 #endif /* CONFIG_XMON */
- 
+
 	/* reboot on panic */	
 	panic_timeout = 180;
 

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