security/vboot: Use persistent context to read GBB flags
With the persistent vboot context coreboot no longer needs to read GBB flags from flash itself -- it can just ask vboot for the cached result. This patch removes the existing GBB code and provides gbb_is_flag_set() (with a slightly better namespaced name) as a static inline instead. Change-Id: Ibc3ed0f3fbeb53d630925d47df4dc474b0ed07ee Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37261 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Joel Kitching <kitching@google.com>
This commit is contained in:
@ -49,6 +49,17 @@ static inline int vboot_is_firmware_slot_a(const struct vb2_context *ctx)
|
||||
return !(ctx->flags & VB2_CONTEXT_FW_SLOT_B);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if given flag is set in the flags field in GBB header.
|
||||
* Return value:
|
||||
* true: Flag is set.
|
||||
* false: Flag is not set.
|
||||
*/
|
||||
static inline bool vboot_is_gbb_flag_set(enum vb2_gbb_flag flag)
|
||||
{
|
||||
return !!(vb2api_gbb_get_flags(vboot_get_context()) & flag);
|
||||
}
|
||||
|
||||
/*
|
||||
* Locates firmware as a region device. Returns 0 on success, -1 on failure.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user