summaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-08-19 15:55:07 +0200
committerRalf Baechle <ralf@linux-mips.org>2008-10-11 17:18:42 +0200
commit265b89db1058124ddbf0091ba3f8c020e3a5ae9d (patch)
treeed7e4a4d78f7d4f32c4b6b467af617479ff5f90e /arch/mips/txx9
parentMIPS: TXx9: Improve handling of built-in and command-line args (diff)
downloadlinux-265b89db1058124ddbf0091ba3f8c020e3a5ae9d.tar.xz
linux-265b89db1058124ddbf0091ba3f8c020e3a5ae9d.zip
MIPS: TXx9: Add prom_getenv
Add prom_getenv() which can be used for YAMON. This assumes other firmware should pass NULL for fw_arg2. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/txx9')
-rw-r--r--arch/mips/txx9/generic/setup.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 33d8c9e3223d..005179c2af21 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -212,6 +212,21 @@ char * __init prom_getcmdline(void)
return &(arcs_cmdline[0]);
}
+const char *__init prom_getenv(const char *name)
+{
+ const s32 *str = (const s32 *)fw_arg2;
+
+ if (!str)
+ return NULL;
+ /* YAMON style ("name", "value" pairs) */
+ while (str[0] && str[1]) {
+ if (!strcmp((const char *)(unsigned long)str[0], name))
+ return (const char *)(unsigned long)str[1];
+ str += 2;
+ }
+ return NULL;
+}
+
static void __noreturn txx9_machine_halt(void)
{
local_irq_disable();