Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38886 )
Change subject: vboot: use vb2api_get_recovery_reason function ......................................................................
vboot: use vb2api_get_recovery_reason function
Use vb2api_get_recovery_reason() API function rather than accessing vb2_shared_data internals.
Of all the vanilla verified boot code in coreboot, this is the last remaining use of vboot's internal data structures in coreboot. There remains only one sole instance in Eltan's code.
BUG=b:124141368, chromium:957880 TEST=make clean && make test-abuild BRANCH=none
Change-Id: I845c9b14ffa830bc7de28e9a38188f7066871803 Signed-off-by: Joel Kitching kitching@google.com Cq-Depend: chromium:2055662 Reviewed-on: https://review.coreboot.org/c/coreboot/+/38886 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/security/vboot/bootmode.c 1 file changed, 1 insertion(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/security/vboot/bootmode.c b/src/security/vboot/bootmode.c index 50b3cc3..2363bf9 100644 --- a/src/security/vboot/bootmode.c +++ b/src/security/vboot/bootmode.c @@ -13,8 +13,6 @@ * GNU General Public License for more details. */
-#define NEED_VB20_INTERNALS /* Peeking into vb2_shared_data */ - #include <assert.h> #include <bootmode.h> #include <bootstate.h> @@ -31,8 +29,7 @@
int vboot_check_recovery_request(void) { - /* TODO: Expose vb2api_recovery_reason() and vb2api_need_train_and_reboot(). */ - return vb2_get_sd(vboot_get_context())->recovery_reason; + return vb2api_get_recovery_reason(vboot_get_context()); }
int vboot_recovery_mode_enabled(void)