summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-08-19 15:17:42 -0700
committerJulius Werner <jwerner@chromium.org>2016-08-23 21:33:29 +0200
commit85b1aadcc1f0cec7eef73a527c5131fb3b1c2f95 (patch)
tree20fecb9addd122768ffaa90768776efc1fef47db /src/lib
parentd9ff75f2cb944d3536f7a502c1c7519843c06618 (diff)
downloadcoreboot-85b1aadcc1f0cec7eef73a527c5131fb3b1c2f95.tar.xz
memlayout: Ensure TIMESTAMP() region is big enough to avoid BUG()
The timestamp code asserts that the _timestamp region (allocated in memlayout for pre-RAM stages) is large enough for the assumptions it makes. This is good, except that we often initialize timestamps extremely early in the bootblock, even before console output. Debugging a BUG() that hits before console_init() is no fun. This patch adds a link-time assertion for the size of the _timestamp region in memlayout to prevent people from accidentally running into this issue. Change-Id: Ibe4301fb89c47fde28e883fd11647d6b62a66fb0 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/16270 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/timestamp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index d8b93f9755..2f2a5d8752 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -27,6 +27,7 @@
#define MAX_TIMESTAMPS 84
+/* When changing this number, adjust TIMESTAMP() size ASSERT() in memlayout.h */
#define MAX_BSS_TIMESTAMP_CACHE 16
struct __attribute__((__packed__)) timestamp_cache {