summaryrefslogtreecommitdiff
path: root/src/security/vboot/misc.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-11-26 17:58:11 -0800
committerJulius Werner <jwerner@chromium.org>2019-11-28 07:03:20 +0000
commitd618aaceae69fa83f630da84036da8ee23ef43e1 (patch)
tree57add8f595faf00617b20dee89ce4999baf1a460 /src/security/vboot/misc.h
parent3e8ef1028dc92d2f06f20e7f80db70002ba84841 (diff)
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>
Diffstat (limited to 'src/security/vboot/misc.h')
-rw-r--r--src/security/vboot/misc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/security/vboot/misc.h b/src/security/vboot/misc.h
index 1b147992d8..471f838a9c 100644
--- a/src/security/vboot/misc.h
+++ b/src/security/vboot/misc.h
@@ -50,6 +50,17 @@ static inline int vboot_is_firmware_slot_a(const struct vb2_context *ctx)
}
/*
+ * 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.
*/
int vboot_locate_firmware(const struct vb2_context *ctx,