mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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>
This commit is contained in:
parent
b828ed7d79
commit
9af341502c
4 changed files with 37 additions and 10 deletions
15
boot/expo.c
15
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue