firmware: header tweaks for depthcharge

Depthcharge currently includes vboot_nvstorage.h directly, instead of
including only the API header files directly.  Add 2nvstorage.h to the
list of headers which can be requested impolitely.

Also fix the definition of ARRAY_SIZE to match exactly what
depthcharge and coreboot provide, so that the compiler does not get
sad when it's included from both libpayload.h and 2common.h.

BUG=chromium:789276
BRANCH=none
TEST=make runtests; emerge-reef depthcharge coreboot

Change-Id: Idc0390eaf813c3079df1676781e8bf5bc9b46450
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/802176
Reviewed-by: Shelley Chen <shchen@chromium.org>
This commit is contained in:
Randall Spangler
2017-11-30 14:09:06 -08:00
committed by chrome-bot
parent 085759742e
commit f6780a36ff
2 changed files with 2 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ struct vb2_public_key;
/* Return the number of elements in an array */ /* Return the number of elements in an array */
#ifndef ARRAY_SIZE #ifndef ARRAY_SIZE
#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0])) #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif #endif
/* Debug output printf() for tests. Otherwise, it's platform-dependent. */ /* Debug output printf() for tests. Otherwise, it's platform-dependent. */

View File

@@ -33,6 +33,7 @@
* TODO: Make cleaner APIs to this stuff. * TODO: Make cleaner APIs to this stuff.
*/ */
#ifdef NEED_VB20_INTERNALS #ifdef NEED_VB20_INTERNALS
#include "../2lib/include/2nvstorage.h"
#include "../2lib/include/2nvstorage_fields.h" #include "../2lib/include/2nvstorage_fields.h"
#include "../2lib/include/2struct.h" #include "../2lib/include/2struct.h"
#include "../lib20/include/vb2_struct.h" #include "../lib20/include/vb2_struct.h"