summaryrefslogtreecommitdiff
path: root/boot/expo.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-06-01 10:22:47 -0600
committerTom Rini <trini@konsulko.com>2023-07-14 12:54:51 -0400
commit9af341502c1cdf1d40a41e8fe6c3922f1e409f33 (patch)
treec6af5359c76642a09cac54ac92b3abeaa2a1efcd /boot/expo.c
parentb828ed7d79295cfebcb0f958f26a33664fae045c (diff)
downloadu-boot-9af341502c1cdf1d40a41e8fe6c3922f1e409f33.tar.gz
u-boot-9af341502c1cdf1d40a41e8fe6c3922f1e409f33.tar.bz2
u-boot-9af341502c1cdf1d40a41e8fe6c3922f1e409f33.zip
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 'boot/expo.c')
-rw-r--r--boot/expo.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/boot/expo.c b/boot/expo.c
index 8b966b6c79..be11cfd4e9 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -56,6 +56,21 @@ void expo_destroy(struct expo *exp)
free(exp);
}
+uint resolve_id(struct expo *exp, uint id)
+{
+ if (!id)
+ id = exp->next_id++;
+ else if (id >= exp->next_id)
+ exp->next_id = id + 1;
+
+ return id;
+}
+
+void expo_set_dynamic_start(struct expo *exp, uint dyn_start)
+{
+ exp->next_id = dyn_start;
+}
+
int expo_str(struct expo *exp, const char *name, uint id, const char *str)
{
struct expo_string *estr;