From: Ralf Baechle Date: Mon, 28 Nov 2005 13:15:08 +0000 (+0000) Subject: [MIPS] Qemu: Accept kernel command line passed by the Emulator. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe3d72858c34a464976c6f8076971e2862d5c3b8;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [MIPS] Qemu: Accept kernel command line passed by the Emulator. From Daniel Jacobowitz . Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/qemu/q-firmware.c b/arch/mips/qemu/q-firmware.c index 5980f02b2df..fb2a8673a6b 100644 --- a/arch/mips/qemu/q-firmware.c +++ b/arch/mips/qemu/q-firmware.c @@ -1,7 +1,18 @@ #include +#include +#include #include 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); + } }