MIPS: TXx9: Make firmware parameter passing more robust
commit16e7d3adcdc28f1d7511cba57ea366448f6fe7b0
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Mon, 27 Oct 2008 14:25:49 +0000 (27 15:25 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 27 Oct 2008 17:20:57 +0000 (27 17:20 +0000)
tree0fe1b0db00e926ca58dbea491b5a17b766ec64db
parentb7e71a08e86c6ad8dbd23eb75b97fbc6764faf26
MIPS: TXx9: Make firmware parameter passing more robust

When booting Linux on a txx9 board with VxWorks boot loader, it crashes in
prom_getenv(), as VxWorks doesn't pass firmware parameters in a0-a3 (in my
case, the actual leftover values in these registers were 0x80002000,
0x80001fe0, 0x2000, and 0x20).

Make the parsing of argc, argv, and envp a bit more robust by checking if
argc is a number below CKSEG0, and argv/envp point to CKSEG0.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/txx9/generic/setup.c