aboutsummaryrefslogtreecommitdiff
path: root/src/security/vboot/vboot_lib.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2020-02-04 17:36:49 +0800
committerMartin Roth <martinroth@google.com>2020-02-07 03:56:44 +0000
commitec12bd011bda6c1364102b497fefbaf65c46880f (patch)
tree17b9ba26af9e7145e506bcdd4e785fe66531f695 /src/security/vboot/vboot_lib.c
parentb40c6009141e2c6a6f886584ea6d5b7e4fe69347 (diff)
security/vboot: relocate vb2ex_abort and vb2ex_printf
Enabling an assertion in vb2_member_of() results in coreboot linking vb2ex_abort() and vb2ex_printf() in ramstage. Move these two functions from vboot_logic.c to vboot_lib.c, which is should be enabled in all stages if CONFIG_VBOOT_LIB is enabled. Note that CONFIG_VBOOT_LIB is implied by CONFIG_VBOOT. Relevant vboot_reference commit: CL:2037263. BUG=b:124141368, chromium:1005700 TEST=make clean && make test-abuild BRANCH=none Change-Id: Ica0103c5684b3d50ba7dc1b4c39559cb192efa81 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38706 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/security/vboot/vboot_lib.c')
-rw-r--r--src/security/vboot/vboot_lib.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/security/vboot/vboot_lib.c b/src/security/vboot/vboot_lib.c
new file mode 100644
index 0000000000..b2303c0295
--- /dev/null
+++ b/src/security/vboot/vboot_lib.c
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* This file is part of the coreboot project. */
+
+#include <console/console.h>
+#include <console/vtxprintf.h>
+#include <vb2_api.h>
+
+/*
+ * vboot callbacks implemented by coreboot -- necessary for making general API
+ * calls when CONFIG_VBOOT_LIB is enabled. For callbacks specific to verstage
+ * (CONFIG_VBOOT), please see vboot_logic.c.
+ */
+
+void vb2ex_printf(const char *func, const char *fmt, ...)
+{
+ va_list args;
+
+ if (func)
+ printk(BIOS_INFO, "VB2:%s() ", func);
+
+ va_start(args, fmt);
+ vprintk(BIOS_INFO, fmt, args);
+ va_end(args);
+}
+
+void vb2ex_abort(void)
+{
+ die("vboot has aborted execution; exit\n");
+}