boot: Add a flag for whether there are global bootmeths

The current 'doing_global' refers to being in the state of processing
global bootmeths. Since global bootmeths are currently used once at the
start, it becomes false once the last global bootmeth has been used.

In preparation for allowing bootmeths to run at other points in the
bootstd interation, add a new 'have_global' flag which tracks whether
there are any global bootmeths in the method_order[] list. It is set up
when iteration starts. Unlike doing_global which resets back to false
after the global bootmeths have been handled, once have_global is set to
true, it remains true for the entire iteration process. This provides a
quick check as to whether global-bootmeth processing is needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-15 16:44:07 +01:00
committed by Tom Rini
parent eca985905d
commit 0fe6de0dc5
3 changed files with 7 additions and 0 deletions

View File

@@ -209,6 +209,7 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global)
iter->first_glob_method != -1 && iter->first_glob_method != count) {
iter->cur_method = iter->first_glob_method;
iter->doing_global = true;
iter->have_global = true;
}
iter->method_order = order;
iter->num_methods = count;