summaryrefslogtreecommitdiff
path: root/include/environment.h
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2018-01-23 21:16:52 +0100
committerTom Rini <trini@konsulko.com>2018-01-27 09:19:11 -0500
commit8a3a7e2270b39f14c1778a574bb815068d8c74d4 (patch)
tree5d22c89f26f30f3372480df7a18475f1708516e3 /include/environment.h
parent52746c43d6aeaa13a39b5cfbd05fce5ee47fbfdc (diff)
env: Pass additional parameters to the env lookup function
In preparation for the multiple environment support, let's introduce two new parameters to the environment driver lookup function: the priority and operation. The operation parameter is meant to identify, obviously, the operation you might want to perform on the environment. The priority is a number passed to identify the environment priority you want to retrieve. The lowest priority parameter (0) will be the primary source. Combining the two parameters allow you to support multiple environments through different priorities, and to change those priorities between read and writes operations. This is especially useful to implement migration mechanisms where you want to always use the same environment first, be it to read or write, while the common case is more likely to use the same environment it has read from to write it to. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'include/environment.h')
-rw-r--r--include/environment.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/environment.h b/include/environment.h
index a2015c299a..a4060506fa 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -205,6 +205,14 @@ enum env_location {
ENVL_UNKNOWN,
};
+/* value for the various operations we want to perform on the env */
+enum env_operation {
+ ENVOP_GET_CHAR, /* we want to call the get_char function */
+ 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 */
+};
+
struct env_driver {
const char *name;
enum env_location location;