[MIPS] Qemu: Accept kernel command line passed by the Emulator.
authorRalf Baechle <ralf@linux-mips.org>
Mon, 28 Nov 2005 13:15:08 +0000 (13:15 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 1 Dec 2005 11:05:15 +0000 (11:05 +0000)
From Daniel Jacobowitz <dan@debian.org>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/qemu/q-firmware.c

index 5980f02b2df9d1ac4df4bab2865cada707bc1d65..fb2a8673a6bf5c0b1d8ef9f150f8531a7f48c360 100644 (file)
@@ -1,7 +1,18 @@
 #include <linux/init.h>
+#include <linux/string.h>
+#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 
 void __init prom_init(void)
 {
-       add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
+       int *cmdline;
+
+       cmdline = (int *) (CKSEG0 + (0x10 << 20) - 260);
+       if (*cmdline == 0x12345678) {
+               if (*(char *)(cmdline + 1))
+                       strcpy (arcs_cmdline, (char *)(cmdline + 1));
+               add_memory_region(0x0<<20, cmdline[-1], BOOT_MEM_RAM);
+       } else {
+               add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
+       }
 }