summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-04-02 15:43:12 -0500
committerAaron Durbin <adurbin@google.com>2015-04-04 15:01:51 +0200
commit46826c36bf1af1dcb4535f0838933f01f600a9d7 (patch)
tree82cc0ab69b8203b0ff5bdbc3096b2127fb31d83e
parentd3f1579df9978215263393e5dead21d3dc92c3a6 (diff)
downloadcoreboot-46826c36bf1af1dcb4535f0838933f01f600a9d7.tar.xz
stddef: Add KHz, MHz and GHz constants
This patch adds some simple constants to more easily write and do math with frequencies, analogous to the existing KiB, MiB and GiB constants for sizes. BUG=None TEST=Compiled Veyron_Pinky. Original-Change-Id: I4a1927fd423eb96d3f76f7e44b451192038b02e0 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/221800 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> (cherry picked from commit 41bb8026818b4381d4a6d43d2d433c207c3971bc) Signed-off-by: Aaron Durbin <adurbin@chromium.org> Change-Id: I1e708b0aa53533c9ab999793ca2273c6dc68b5f6 Reviewed-on: http://review.coreboot.org/9253 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--src/include/stddef.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/stddef.h b/src/include/stddef.h
index 60e34595ee..3bbf914246 100644
--- a/src/include/stddef.h
+++ b/src/include/stddef.h
@@ -26,6 +26,10 @@ typedef unsigned int wint_t;
/* Could we ever run into this one? I hope we get this much memory! */
#define TiB (1<<40)
+#define KHz (1000)
+#define MHz (1000 * KHz)
+#define GHz (1000 * MHz)
+
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#define check_member(structure, member, offset) _Static_assert( \