Stefan Reinauer (stefan.reinauer@coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10788
-gerrit
commit 4c3b4bcc71e21fe5477bd29719e8d50ec5e83cef Author: Daisuke Nojiri dnojiri@chromium.org Date: Mon Jun 29 13:33:34 2015 -0700
Define check_member() and KHz/MHz/GHz in stddef.h
BUG=none BRANCH=tot TEST=built coreboot/libpayload for veyron_jerry
Change-Id: I17885e08840f42d1400660f075acc7c054bb9d33 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org Original-Commit-Id: Original-Change-Id: I30e6d87c9de827a214a6100449cd716e773c2ba3 Original-Signed-off-by: Daisuke Nojiri dnojiri@chromium.org Original-Reviewed-on: https://chromium-review.googlesource.com/282587 Original-Reviewed-by: Randall Spangler rspangler@chromium.org --- payloads/libpayload/include/stddef.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h index bb2971d..fe455b8 100644 --- a/payloads/libpayload/include/stddef.h +++ b/payloads/libpayload/include/stddef.h @@ -16,7 +16,15 @@ typedef __SIZE_TYPE__ ssize_t; #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) #define member_size(TYPE, MEMBER) (sizeof(((TYPE *) 0)->MEMBER))
+#define check_member(structure, member, offset) _Static_assert( \ + offsetof(struct structure, member) == offset, \ + "`struct " #structure "` offset for `" #member "` is not " #offset) + /* Standard units. */ #define KiB (1<<10) #define MiB (1<<20) #define GiB (1<<30) + +#define KHz (1000) +#define MHz (1000*KHz) +#define GHz (1000*MHz)