diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-08-19 09:55:07 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-10-11 11:18:42 -0400 |
commit | 265b89db1058124ddbf0091ba3f8c020e3a5ae9d (patch) | |
tree | ed7e4a4d78f7d4f32c4b6b467af617479ff5f90e /arch | |
parent | e0dfb20c2b77c6626a24578240266ace928cd2e7 (diff) |
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')
-rw-r--r-- | arch/mips/txx9/generic/setup.c | 15 |
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) | |||
212 | return &(arcs_cmdline[0]); | 212 | return &(arcs_cmdline[0]); |
213 | } | 213 | } |
214 | 214 | ||
215 | const char *__init prom_getenv(const char *name) | ||
216 | { | ||
217 | const s32 *str = (const s32 *)fw_arg2; | ||
218 | |||
219 | if (!str) | ||
220 | return NULL; | ||
221 | /* YAMON style ("name", "value" pairs) */ | ||
222 | while (str[0] && str[1]) { | ||
223 | if (!strcmp((const char *)(unsigned long)str[0], name)) | ||
224 | return (const char *)(unsigned long)str[1]; | ||
225 | str += 2; | ||
226 | } | ||
227 | return NULL; | ||
228 | } | ||
229 | |||
215 | static void __noreturn txx9_machine_halt(void) | 230 | static void __noreturn txx9_machine_halt(void) |
216 | { | 231 | { |
217 | local_irq_disable(); | 232 | local_irq_disable(); |