summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/2gbb.c6
-rw-r--r--firmware/2lib/include/2api.h11
2 files changed, 17 insertions, 0 deletions
diff --git a/firmware/2lib/2gbb.c b/firmware/2lib/2gbb.c
index 75eed57e..8a7c57c5 100644
--- a/firmware/2lib/2gbb.c
+++ b/firmware/2lib/2gbb.c
@@ -122,3 +122,9 @@ int vb2api_gbb_read_hwid(struct vb2_context *ctx,
return VB2_SUCCESS;
}
+
+vb2_gbb_flags_t vb2api_gbb_get_flags(struct vb2_context *ctx)
+{
+ struct vb2_gbb_header *gbb = vb2_get_gbb(ctx);
+ return gbb->flags;
+}
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 9cab74e9..487616d4 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -664,6 +664,17 @@ int vb2api_gbb_read_hwid(struct vb2_context *ctx,
char *hwid,
uint32_t *size);
+/**
+ * Retrieve current GBB flags.
+ *
+ * See enum vb2_gbb_flag in 2gbb_flags.h for a list of all GBB flags.
+ *
+ * @param ctx Vboot context.
+ *
+ * @return vb2_gbb_flags_t representing current GBB flags.
+ */
+vb2_gbb_flags_t vb2api_gbb_get_flags(struct vb2_context *ctx);
+
/*****************************************************************************/
/* APIs provided by the caller to verified boot */