diff options
author | Frank Wunderlich <frank-w@public-files.de> | 2019-06-29 11:36:19 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-18 11:31:25 -0400 |
commit | cd121bdb6df3fe8dfe45ff1e34f46f86b8f060c0 (patch) | |
tree | 32dd275494f021a9ea3b8f9ddcc1ed5855b6c900 /include/environment.h | |
parent | 4225f830c56d6a8f6e459bce8cec310a58a9df28 (diff) |
env: register erase command
this patch adds basic changes for adding a erase-subcommand to env
with this command the environment stored on non-volatile storage written
by saveenv can be cleared.
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
squashed fixes
- start message with "Erasing"
- mark erase-function as optional
- env: separate eraseenv from saveenv
Suggested-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Diffstat (limited to 'include/environment.h')
-rw-r--r-- | include/environment.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/environment.h b/include/environment.h index cd966761416..de67cf4f0ea 100644 --- a/include/environment.h +++ b/include/environment.h @@ -200,6 +200,7 @@ enum env_operation { ENVOP_INIT, /* we want to call the init function */ ENVOP_LOAD, /* we want to call the load function */ ENVOP_SAVE, /* we want to call the save function */ + ENVOP_ERASE, /* we want to call the erase function */ }; struct env_driver { @@ -226,6 +227,15 @@ struct env_driver { int (*save)(void); /** + * erase() - Erase the environment on storage + * + * This method is optional and required for 'eraseenv' to work. + * + * @return 0 if OK, -ve on error + */ + int (*erase)(void); + + /** * init() - Set up the initial pre-relocation environment * * This method is optional. @@ -304,6 +314,13 @@ int env_load(void); int env_save(void); /** + * env_erase() - Erase the environment on storage + * + * @return 0 if OK, -ve on error + */ +int env_erase(void); + +/** * env_fix_drivers() - Updates envdriver as per relocation */ void env_fix_drivers(void); |