summaryrefslogtreecommitdiff
path: root/include/util.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-05-08 14:34:03 -0700
committerBill Richardson <wfrichar@chromium.org>2012-05-10 17:27:36 -0700
commit8101b7131651e344807d2bd0ec77542b3196a653 (patch)
treedf058964eee0efdfe82cfa2bd0f7e6ef013c45b8 /include/util.h
parent058079977e3d94d05d40e44144549b9d4e391144 (diff)
downloadchrome-ec-8101b7131651e344807d2bd0ec77542b3196a653.tar.gz
Enable verified boot for EC firmware
BUG=chrome-os-partner:7459 TEST=manual In the chroot: cd src/platform/ec make BOARD=link The firmware image (build/link/ec.bin) is signed with dev-keys. Reflash the EC and try it, and it should verify and reboot into RW A. Additional tests (setting USE_RO_NORMAL, poking random values into VBLOCK_A or FW_MAIN_A to force RW B to run, etc.) are left as an exercise for the reader. I've done them and they work, though. Change-Id: I29a23ea69aef02a11aebd4af3b043f6864723523 Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/util.h')
-rw-r--r--include/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h
index 6f8fe1c581..3fb0657061 100644
--- a/include/util.h
+++ b/include/util.h
@@ -32,10 +32,18 @@
/* Standard macros / definitions */
+#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef NULL
#define NULL ((void *)0)
+#endif
/**
* macros for integer division with various rounding variants