diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-12-11 22:16:34 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-12-13 11:46:56 -0700 |
commit | 267541f776f1e2bec21681c6e39a4c93af9621cf (patch) | |
tree | 861ff411eab98193f9914d30ec420628e79912e0 /common/env_common.c | |
parent | fffad71bc489cf224eda6d826a1645423852ee45 (diff) | |
download | u-boot-imx-267541f776f1e2bec21681c6e39a4c93af9621cf.zip u-boot-imx-267541f776f1e2bec21681c6e39a4c93af9621cf.tar.gz u-boot-imx-267541f776f1e2bec21681c6e39a4c93af9621cf.tar.bz2 |
env: Add support for access control to .flags
Add support for read-only, write-once, and change-default.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'common/env_common.c')
-rw-r--r-- | common/env_common.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/env_common.c b/common/env_common.c index bb18070..906b41f 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -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; |