aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass2023-06-01 10:22:47 -0600
committerTom Rini2023-07-14 12:54:51 -0400
commit9af341502c1cdf1d40a41e8fe6c3922f1e409f33 (patch)
treec6af5359c76642a09cac54ac92b3abeaa2a1efcd /include
parentb828ed7d79295cfebcb0f958f26a33664fae045c (diff)
expo: Allow setting the start of the dynamic-ID range
Provide a way to set this value so that it is easy to separate the statically allocated IDs (generated by the caller) from those generated dynamically by expo itself. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/expo.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/expo.h b/include/expo.h
index f77ee708519..b8f5327f266 100644
--- a/include/expo.h
+++ b/include/expo.h
@@ -258,6 +258,25 @@ int expo_new(const char *name, void *priv, struct expo **expp);
void expo_destroy(struct expo *exp);
/**
+ * expo_set_dynamic_start() - Set the start of the 'dynamic' IDs
+ *
+ * It is common for a set of 'static' IDs to be used to refer to objects in the
+ * expo. These typically use an enum so that they are defined in sequential
+ * order.
+ *
+ * Dynamic IDs (for objects not in the enum) are intended to be used for
+ * objects to which the code does not need to refer. These are ideally located
+ * above the static IDs.
+ *
+ * Use this function to set the start of the dynamic range, making sure that the
+ * value is higher than all the statically allocated IDs.
+ *
+ * @exp: Expo to update
+ * @dyn_start: Start ID that expo should use for dynamic allocation
+ */
+void expo_set_dynamic_start(struct expo *exp, uint dyn_start);
+
+/**
* expo_str() - add a new string to an expo
*
* @exp: Expo to update