Joel Kitching has uploaded this change for review.

View Change

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_common.c,
which is linked into ramstage.

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>
---
M src/security/vboot/vboot_common.c
M src/security/vboot/vboot_logic.c
2 files changed, 23 insertions(+), 21 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/38706/1
diff --git a/src/security/vboot/vboot_common.c b/src/security/vboot/vboot_common.c
index 3342524..73aefe2 100644
--- a/src/security/vboot/vboot_common.c
+++ b/src/security/vboot/vboot_common.c
@@ -16,6 +16,8 @@
#include <boot_device.h>
#include <cbmem.h>
#include <console/cbmem_console.h>
+#include <console/console.h>
+#include <console/vtxprintf.h>
#include <fmap.h>
#include <reset.h>
#include <stddef.h>
@@ -56,3 +58,24 @@
vboot_platform_prepare_reboot();
board_reset();
}
+
+/* exports */
+
+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);
+
+ return;
+}
+
+void vb2ex_abort(void)
+{
+ die("vboot has aborted execution; exit\n");
+}
diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c
index 1d17a17..182128c 100644
--- a/src/security/vboot/vboot_logic.c
+++ b/src/security/vboot/vboot_logic.c
@@ -17,8 +17,6 @@
#include <assert.h>
#include <bootmode.h>
#include <cbmem.h>
-#include <console/console.h>
-#include <console/vtxprintf.h>
#include <fmap.h>
#include <string.h>
#include <timestamp.h>
@@ -37,20 +35,6 @@

/* exports */

-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);
-
- return;
-}
-
vb2_error_t vb2ex_read_resource(struct vb2_context *ctx,
enum vb2_resource_index index,
uint32_t offset,
@@ -83,11 +67,6 @@
return VB2_SUCCESS;
}

-void vb2ex_abort(void)
-{
- die("vboot has aborted execution; exit\n");
-}
-
/* No-op stubs that can be overridden by SoCs with hardware crypto support. */
__weak vb2_error_t vb2ex_hwcrypto_digest_init(enum vb2_hash_algorithm hash_alg,
uint32_t data_size)

To view, visit change 38706. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ica0103c5684b3d50ba7dc1b4c39559cb192efa81
Gerrit-Change-Number: 38706
Gerrit-PatchSet: 1
Gerrit-Owner: Joel Kitching <kitching@google.com>
Gerrit-MessageType: newchange