program loading: add optional is_loader_active() callback

Add a way for a loader to indicate if it is active. Such users
of this callback would be vboot which can indicate to the rest
of the system that it isn't active. is_loader_active() also
gives vboot a chance to perform the necessary work to make
said decision.

Change-Id: I6679ac75b19bb1bfff9c2b709da5591986f752ff
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/10022
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Aaron Durbin
2015-04-28 15:59:12 -05:00
committed by Patrick Georgi
parent 16110e7ffa
commit 5e8286bed6
4 changed files with 54 additions and 2 deletions

View File

@ -103,6 +103,9 @@ void platform_prog_run(struct prog *prog);
struct prog_loader_ops {
const char *name;
/* Determine if the loader is the active one. If so returns 1 else 0
* or < 0 on error. */
int (*is_loader_active)(struct prog *prog);
/* Returns < 0 on error or 0 on success. This function needs to do
* different things depending on the prog type. See definition
* of struct prog above. */