]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/env_common.c
env: Add support for access control to .flags
[karo-tx-uboot.git] / common / env_common.c
index bb18070c54af55dd847a1b239ac98ffb2f76dabf..906b41fccada86dc41d58d23ad42f74e7d5476b2 100644 (file)
@@ -95,6 +95,24 @@ int getenv_yesno(const char *var)
                1 : 0;
 }
 
+/*
+ * Look up the variable from the default environment
+ */
+char *getenv_default(const char *name)
+{
+       char *ret_val;
+       unsigned long really_valid = gd->env_valid;
+       unsigned long real_gd_flags = gd->flags;
+
+       /* Pretend that the image is bad. */
+       gd->flags &= ~GD_FLG_ENV_READY;
+       gd->env_valid = 0;
+       ret_val = getenv(name);
+       gd->env_valid = really_valid;
+       gd->flags = real_gd_flags;
+       return ret_val;
+}
+
 void set_default_env(const char *s)
 {
        int flags = 0;