summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-06-14 14:00:10 +0800
committerCommit Bot <commit-bot@chromium.org>2019-06-14 21:44:51 +0000
commit01b1a94bcc62cc15d2f7f405385f6f99309f9134 (patch)
treee2e0aa7e389372ff282cbd4ac22fabe89b313d3a /firmware
parent5306ca28f4c077cb3e1dac0e0e7bbb35ef37687c (diff)
downloadvboot-01b1a94bcc62cc15d2f7f405385f6f99309f9134.tar.gz
vboot: add vb2api_gbb_get_flags function
BUG=b:124141368, chromium:954774 TEST=make clean && make runtests BRANCH=none Change-Id: I7b422e8a26621720a6b7efc5211629996a6aa385 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1659989 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Auto-Submit: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
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 */