summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2020-07-07 20:51:35 +0200
committerTom Rini <trini@konsulko.com>2020-07-31 10:13:00 -0400
commit890feecaab72a630eac3344443e053173f4ad02f (patch)
treec36661a5b3a0d8e65f813cc1f5fcf06d3f100d2c /include
parentef9bef2bfed36424a3a6678d76d9eb7b710de1ac (diff)
downloadu-boot-890feecaab72a630eac3344443e053173f4ad02f.tar.gz
env: Discern environment coming from external storage
Add another custom environment flag which discerns environment coming from external storage from environment set by U-Boot itself. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/env.h7
-rw-r--r--include/search.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/include/env.h b/include/env.h
index 665857f032..af405955b0 100644
--- a/include/env.h
+++ b/include/env.h
@@ -302,10 +302,11 @@ int env_select(const char *name);
* @buf: Buffer containing the environment (struct environemnt_s *)
* @check: non-zero to check the CRC at the start of the environment, 0 to
* ignore it
+ * @flags: Flags controlling matching (H_... - see search.h)
* @return 0 if imported successfully, -ENOMSG if the CRC was bad, -EIO if
* something else went wrong
*/
-int env_import(const char *buf, int check);
+int env_import(const char *buf, int check, int flags);
/**
* env_export() - Export the environment to a buffer
@@ -324,10 +325,12 @@ int env_export(struct environment_s *env_out);
* @buf1_read_fail: 0 if buf1 is valid, non-zero if invalid
* @buf2: Second environment (struct environemnt_s *)
* @buf2_read_fail: 0 if buf2 is valid, non-zero if invalid
+ * @flags: Flags controlling matching (H_... - see search.h)
* @return 0 if OK, -EIO if no environment is valid, -ENOMSG if the CRC was bad
*/
int env_import_redund(const char *buf1, int buf1_read_fail,
- const char *buf2, int buf2_read_fail);
+ const char *buf2, int buf2_read_fail,
+ int flags);
/**
* env_get_default() - Look up a variable from the default environment
diff --git a/include/search.h b/include/search.h
index c4b50c9630..e56843c26f 100644
--- a/include/search.h
+++ b/include/search.h
@@ -113,5 +113,6 @@ int hwalk_r(struct hsearch_data *htab,
#define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from env_set() */
#define H_ORIGIN_FLAGS (H_INTERACTIVE | H_PROGRAMMATIC)
#define H_DEFAULT (1 << 10) /* indicate that an import is default env */
+#define H_EXTERNAL (1 << 11) /* indicate that an import is external env */
#endif /* _SEARCH_H_ */