summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-03 12:21:56 -0600
committerTom Rini <trini@konsulko.com>2017-08-15 08:18:51 -0400
commit203e94f6c9ca03e260175ce240f5856507395585 (patch)
tree1b13b0ff87c4117e18e6ee7db97e09c541724b69 /include
parent75de597d2d91b1102584d4b641daf592d894207e (diff)
env: Add an enum for environment state
At present we have three states for the environment, numbered 0, 1 and 2. Add an enum to record this to avoid open-coded values. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/global_data.h2
-rw-r--r--include/environment.h7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 86bf6565f6..8b32d514c3 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -49,7 +49,7 @@ typedef struct global_data {
unsigned long precon_buf_idx; /* Pre-Console buffer index */
#endif
unsigned long env_addr; /* Address of Environment struct */
- unsigned long env_valid; /* Checksum of Environment valid? */
+ unsigned long env_valid; /* Environment valid? enum env_valid */
unsigned long ram_top; /* Top address of RAM used by U-Boot */
unsigned long relocaddr; /* Start address of U-Boot in RAM */
diff --git a/include/environment.h b/include/environment.h
index 5f2064bf23..ad2331c90b 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -197,6 +197,13 @@ extern uint mmc_get_env_part(struct mmc *mmc);
#include <env_flags.h>
#include <search.h>
+/* Value for environment validity */
+enum env_valid {
+ ENV_INVALID, /* No valid environment */
+ ENV_VALID, /* First or only environment is valid */
+ ENV_REDUND, /* Redundant environment is valid */
+};
+
extern struct hsearch_data env_htab;
/* Function that returns a character from the environment */