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>
This commit is contained in:
Joel Kitching 2020-02-14 15:41:11 +08:00 committed by Patrick Georgi
parent 24d994afd2
commit 338e9dcd6b
1 changed files with 1 additions and 4 deletions

View File

@ -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)