summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2006-05-27 23:36:41 +0400
committerRalf Baechle <ralf@linux-mips.org>2006-06-06 00:15:17 +0100
commitfef6d6a73a3985e4fdb5ab1910909c0c73539829 (patch)
tree15cfecce58c3e95be680c6af750b807eac4f2d35 /arch
parent6ebba0e2f56ee77270a9ef8e92c1b4ec38e5f419 (diff)
downloadlwn-fef6d6a73a3985e4fdb5ab1910909c0c73539829.tar.gz
lwn-fef6d6a73a3985e4fdb5ab1910909c0c73539829.zip
[MIPS] Au1xx0: fix prom_getenv() to handle YAMON style environment
Alchemy boards use YAMON which passes the environment variables as the tuples of strings (the name followed by the value) unlike PMON which passes "name=<val>" strings. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/au1000/common/prom.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c
index 9c171afd9a53..ae7d8c57bf3f 100644
--- a/arch/mips/au1000/common/prom.c
+++ b/arch/mips/au1000/common/prom.c
@@ -1,10 +1,9 @@
/*
*
* BRIEF MODULE DESCRIPTION
- * PROM library initialisation code, assuming a version of
- * pmon is the boot code.
+ * PROM library initialisation code, assuming YAMON is the boot loader.
*
- * Copyright 2000,2001 MontaVista Software Inc.
+ * Copyright 2000, 2001, 2006 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
@@ -49,9 +48,9 @@ extern char **prom_argv, **prom_envp;
typedef struct
{
- char *name;
-/* char *val; */
-}t_env_var;
+ char *name;
+ char *val;
+} t_env_var;
char * prom_getcmdline(void)
@@ -85,21 +84,16 @@ char *prom_getenv(char *envname)
{
/*
* Return a pointer to the given environment variable.
- * Environment variables are stored in the form of "memsize=64".
*/
t_env_var *env = (t_env_var *)prom_envp;
- int i;
-
- i = strlen(envname);
- while(env->name) {
- if(strncmp(envname, env->name, i) == 0) {
- return(env->name + strlen(envname) + 1);
- }
+ while (env->name) {
+ if (strcmp(envname, env->name) == 0)
+ return env->val;
env++;
}
- return(NULL);
+ return NULL;
}
inline unsigned char str2hexnum(unsigned char c)