summaryrefslogtreecommitdiff
path: root/common/env_flags.c
Commit message (Collapse)AuthorAgeLines
* MLK-12201 common: env: fix out of bounds readPeng Fan2016-03-04-1/+1
| | | | | | | | | We should use ARRAY_SIZE, but not directly sizeof, otherwise we may access memory that is not belong the array env_flags_varaccess_mask. Coverity ID: 17949 Signed-off-by: Peng Fan <peng.fan@nxp.com>
* MLK-12199 common:env fix unintialized scalar valuePeng Fan2016-03-04-0/+1
| | | | | | | Reported by coverity ID: 17900 17902 Using uninitialized value e. Field e.flags is uninitialized when calling hsearch_r Signed-off-by: Peng Fan <peng.fan@nxp.com>
* common: env: initialize scalar variablePeng Fan2016-03-04-0/+1
| | | | | | | | | | | | | | | | | Before calling hsearch_r, initialize callback entry to NULL. Coverity log: " Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized value e. Field e.callback is uninitialized when calling hsearch_r. " Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> (cherry picked from commit 5a6894397a657edec5d0cf4e20968cc66a368c51)
* common, env: optimize boottimeHeiko Schocher2014-01-14-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | when creating the hashtable, for each environmentvariable getenv(ENV_CALLBACK_VAR) and getenv(ENV_FLAGS_VAR) is called, which costs at this point a lot of time. So call this two getenv() calls only once. Boottime on the ids8313 board without this patch: 2013-12-19 13:38:22,894: NAND: 128 MiB 2013-12-19 13:38:27,659: In: serial (~4.8 sec) Bootime with this patch on the ids8313 board: 2013-12-19 13:40:25,332: NAND: 128 MiB 2013-12-19 13:40:25,546: In: serial (~0.2 sec) Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Wolfgang Denk <wd@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* env: Handle write-once ethaddr and serial# genericallyJoe Hershberger2012-12-13-19/+0
| | | | | | | Use the variable access flags to implement the protection for ethaddr and serial# instead of hard-coding them. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* env: Add support for access control to .flagsJoe Hershberger2012-12-13-4/+155
| | | | | | Add support for read-only, write-once, and change-default. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* env: Add a command to display details about env flagsJoe Hershberger2012-12-13-0/+34
| | | | | | | Similar to the env callback command, this will show details about the options available, the static list, and the currently active variables. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* tools/env: Add environment variable flags supportJoe Hershberger2012-12-13-0/+75
| | | | | | | | | | | | | | Currently just validates variable types as decimal, hexidecimal, boolean, ip address, and mac address. Call env_acl_validate_setenv_params() from setenv() in fw_env.c. If the entry is not found in the env .flags, then look in the static one. This allows the env to override the static definitions, but prevents the need to have every definition in the environment distracting you. Need to build in _ctype for isdigit for Linux. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* env: Add environment variable flagsJoe Hershberger2012-12-13-0/+319
Currently just validates variable types as decimal, hexidecimal, boolean, ip address, and mac address. If the entry is not found in the env ".flags", then look in the static one. This allows the env to override the static definitions, but prevents the need to have every definition in the environment distracting you. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>