[coreboot-gerrit] Patch set updated for coreboot: commonlib/include: remove NEED_VB20_INTERNALS

Aaron Durbin (adurbin@chromium.org) gerrit at coreboot.org
Fri Nov 18 16:31:16 CET 2016


Aaron Durbin (adurbin at chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17475

-gerrit

commit 90a738492b3d1878f106b96c6612f7e4b79999cd
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Fri Nov 18 09:05:18 2016 -0600

    commonlib/include: remove NEED_VB20_INTERNALS
    
    vboot_handoff.c is the only place that needs the vb2 internals.
    Provide it in the one place it is actually required instead of
    pulling in the headers unnecessarily in common code. There is,
    however, still a need to get the vb2 hashing types for a function
    declaration.
    
    Change-Id: I038fda68b1cd05fa2e66135158e5e2d18567563a
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 src/commonlib/include/commonlib/cbfs.h |  2 --
 src/vboot/vboot_handoff.c              | 13 +++++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/commonlib/include/commonlib/cbfs.h b/src/commonlib/include/commonlib/cbfs.h
index 5e511a7..163bef2 100644
--- a/src/commonlib/include/commonlib/cbfs.h
+++ b/src/commonlib/include/commonlib/cbfs.h
@@ -18,8 +18,6 @@
 
 #include <commonlib/cbfs_serialized.h>
 #include <commonlib/region.h>
-/* TODO: remove me! This is for vboot_handoff.c's benefit. */
-#define NEED_VB20_INTERNALS
 #include <vb2_api.h>
 
 /* Object representing cbfs files. */
diff --git a/src/vboot/vboot_handoff.c b/src/vboot/vboot_handoff.c
index b732b3a..2533a1d 100644
--- a/src/vboot/vboot_handoff.c
+++ b/src/vboot/vboot_handoff.c
@@ -13,11 +13,18 @@
  * GNU General Public License for more details.
  */
 
+/* This needs to be pulled in first so that the handoff code below and
+ * peek into the vb2 data structures. Additionally, vboot doesn't currently
+ * include what it uses in its own headers. Provide the types it's after.
+ * TODO: fix this necessity. */
+#define NEED_VB20_INTERNALS
+#include <stddef.h>
+#include <stdint.h>
+#include <vb2_api.h>
+
 #include <arch/stages.h>
 #include <assert.h>
 #include <bootmode.h>
-#include <stdint.h>
-#include <stddef.h>
 #include <string.h>
 #include <cbfs.h>
 #include <cbmem.h>
@@ -26,8 +33,6 @@
 #include <fmap.h>
 #include <stdlib.h>
 #include <timestamp.h>
-#define NEED_VB20_INTERNALS  /* TODO: remove me! */
-#include <vb2_api.h>
 #include <vboot_struct.h>
 #include <vboot/vbnv.h>
 #include <vboot/misc.h>



More information about the coreboot-gerrit mailing list