vboot: Clean up vboot code
1. Remove unused functions/structures.
2. Add checks for NULL return values.
3. Change prefixes to vb2 instead of vboot for functions used internally
within vboot2/
4. Get rid of vboot_handoff.h file and move the structure definition to
vboot_common.h
5. Rename all functions using handoff structure to have prefix
vboot_handoff_*. All the handoff functions can be run _only_ after cbmem
is online.
6. Organize vboot_common.h content according to different
functionalities.
BUG=chrome-os-partner:55431
Change-Id: I4c07d50327d88cddbdfbb0b6f82c264e2b8620eb
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15799
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
diff --git a/src/vendorcode/google/chromeos/vboot2/vboot_loader.c b/src/vendorcode/google/chromeos/vboot2/vboot_loader.c
index f6efe0f..7541518 100644
--- a/src/vendorcode/google/chromeos/vboot2/vboot_loader.c
+++ b/src/vendorcode/google/chromeos/vboot2/vboot_loader.c
@@ -21,7 +21,7 @@
#include <rules.h>
#include <string.h>
#include "misc.h"
-#include "../vboot_handoff.h"
+#include "../vboot_common.h"
#include "../symbols.h"
/* The stage loading code is compiled and entered from multiple stages. The
@@ -61,7 +61,7 @@
static int vboot_executed CAR_GLOBAL;
-static int vboot_logic_executed(void)
+int vb2_logic_executed(void)
{
/* If this stage is supposed to run the vboot logic ensure it has been
* executed. */
@@ -139,7 +139,7 @@
struct region selected_region;
/* Don't honor vboot results until the vboot logic has run. */
- if (!vboot_logic_executed())
+ if (!vb2_logic_executed())
return -1;
if (vb2_get_selected_region(&selected_region))