env: Move env_relocate() to env.h
[platform/kernel/u-boot.git] / include / env.h
index b82d80d..7298096 100644 (file)
 int env_get_id(void);
 
 /**
+ * env_init() - Set up the pre-relocation environment
+ *
+ * This locates the environment or uses the default if nothing is available.
+ * This must be called before env_get() will work.
+ *
+ * @return 0 if OK, -ENODEV if no environment drivers are enabled
+ */
+int env_init(void);
+
+/**
+ * env_relocate() - Set up the post-relocation environment
+ *
+ * This loads the environment into RAM so that it can be modified. This is
+ * called after relocation, before the environment is used
+ */
+void env_relocate(void);
+
+/**
+ * env_get_f() - Look up the value of an environment variable (early)
+ *
+ * This function is called from env_get() if the environment has not been
+ * loaded yet (GD_FLG_ENV_READY flag is 0). Some environment locations will
+ * support reading the value (slowly) and some will not.
+ *
+ * @varname:   Variable to look up
+ * @return value of variable, or NULL if not found
+ */
+int env_get_f(const char *name, char *buf, unsigned int len);
+
+/**
  * env_complete() - return an auto-complete for environment variables
  *
  * @var: partial name to auto-complete