projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change env_get_char from a global function ptr to a function.
[oweals/u-boot.git]
/
common
/
cmd_nvedit.c
diff --git
a/common/cmd_nvedit.c
b/common/cmd_nvedit.c
index 1db0fc3c03b14c4a3fb0761b2cc77bc4b562e7ed..dc05f68bfeb27b1efdfc6b832dacbcb0f1b763ed 100644
(file)
--- a/
common/cmd_nvedit.c
+++ b/
common/cmd_nvedit.c
@@
-57,8
+57,9
@@
DECLARE_GLOBAL_DATA_PTR;
!defined(CFG_ENV_IS_IN_FLASH) && \
!defined(CFG_ENV_IS_IN_DATAFLASH) && \
!defined(CFG_ENV_IS_IN_NAND) && \
!defined(CFG_ENV_IS_IN_FLASH) && \
!defined(CFG_ENV_IS_IN_DATAFLASH) && \
!defined(CFG_ENV_IS_IN_NAND) && \
+ !defined(CFG_ENV_IS_IN_ONENAND) && \
!defined(CFG_ENV_IS_NOWHERE)
!defined(CFG_ENV_IS_NOWHERE)
-# error Define one of CFG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|NOWHERE}
+# error Define one of CFG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|
ONENAND|
NOWHERE}
#endif
#define XMK_STR(x) #x
#endif
#define XMK_STR(x) #x
@@
-67,9
+68,6
@@
DECLARE_GLOBAL_DATA_PTR;
/************************************************************************
************************************************************************/
/************************************************************************
************************************************************************/
-/* Function that returns a character from the environment */
-extern uchar (*env_get_char)(int);
-
/* Function that returns a pointer to a value from the environment */
/* (Only memory version supported / needed). */
extern uchar *env_get_addr(int);
/* Function that returns a pointer to a value from the environment */
/* (Only memory version supported / needed). */
extern uchar *env_get_addr(int);
@@
-80,8
+78,6
@@
extern void env_crc_update (void);
/************************************************************************
************************************************************************/
/************************************************************************
************************************************************************/
-static int envmatch (uchar *, int);
-
/*
* Table with supported baudrates (defined in config_xyz.h)
*/
/*
* Table with supported baudrates (defined in config_xyz.h)
*/
@@
-551,9
+547,11
@@
int getenv_r (char *name, char *buf, unsigned len)
return (-1);
}
return (-1);
}
-#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
+#if
((
defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND))
+ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
+ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
+ && !defined(CFG_ENV_IS_NOWHERE))
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
extern char * env_name_spec;
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
extern char * env_name_spec;
@@
-574,8
+572,7
@@
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* If the names match, return the index for the value2, else NULL.
*/
* If the names match, return the index for the value2, else NULL.
*/
-static int
-envmatch (uchar *s1, int i2)
+int envmatch (uchar *s1, int i2)
{
while (*s1 == env_get_char(i2++))
{
while (*s1 == env_get_char(i2++))
@@
-606,9
+603,11
@@
U_BOOT_CMD(
" - delete environment variable 'name'\n"
);
" - delete environment variable 'name'\n"
);
-#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
+#if
((
defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND))
+ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
+ || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
+ && !defined(CFG_ENV_IS_NOWHERE))
U_BOOT_CMD(
saveenv, 1, 0, do_saveenv,
"saveenv - save environment variables to persistent storage\n",
U_BOOT_CMD(
saveenv, 1, 0, do_saveenv,
"saveenv - save environment variables to persistent storage\n",