Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32567
b: refs/heads/master
c: 6fe725c
h: refs/heads/master
i:
  32565: cfdaa34
  32563: 73214c3
  32559: 5090d66
v: v3
  • Loading branch information
Domen Puncer authored and Ralf Baechle committed Jul 13, 2006
1 parent 78a17d5 commit 32ff0e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c36cd4bab5084798b401d529129a950f4a48662d
refs/heads/master: 6fe725c01c0c547c4287ba3de5ebc8f884178409
26 changes: 14 additions & 12 deletions trunk/arch/mips/au1000/common/prom.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
*
* BRIEF MODULE DESCRIPTION
* PROM library initialisation code, assuming YAMON is the boot loader.
* PROM library initialisation code, supports YAMON and U-Boot.
*
* Copyright 2000, 2001, 2006 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
Expand Down Expand Up @@ -46,12 +46,6 @@
extern int prom_argc;
extern char **prom_argv, **prom_envp;

typedef struct
{
char *name;
char *val;
} t_env_var;


char * prom_getcmdline(void)
{
Expand Down Expand Up @@ -84,13 +78,21 @@ char *prom_getenv(char *envname)
{
/*
* Return a pointer to the given environment variable.
* YAMON uses "name", "value" pairs, while U-Boot uses "name=value".
*/

t_env_var *env = (t_env_var *)prom_envp;

while (env->name) {
if (strcmp(envname, env->name) == 0)
return env->val;
char **env = prom_envp;
int i = strlen(envname);
int yamon = (*env && strchr(*env, '=') == NULL);

while (*env) {
if (yamon) {
if (strcmp(envname, *env++) == 0)
return *env;
} else {
if (strncmp(envname, *env, i) == 0 && (*env)[i] == '=')
return *env + i + 1;
}
env++;
}
return NULL;
Expand Down

0 comments on commit 32ff0e8

Please sign in to comment.