summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-09-23 08:08:33 -0600
committerCommit Bot <commit-bot@chromium.org>2020-10-01 19:14:20 +0000
commit5464f91364f648e31437844a923b97cc10388a9d (patch)
tree7b2ab26eefbb12ef3d21b1358dafa44eb9e20fb8
parent472d96e4b3e6a6215ce5b02f89f5881c5cefdd1b (diff)
downloadchrome-ec-5464f91364f648e31437844a923b97cc10388a9d.tar.gz
zephyr: make common.h compatible with Zephyr
Zephyr provides definitions for these macros. Guard them away in the preprocessor so we don't get warnings about duplicate definitions. BUG=b:167590251 BRANCH=none TEST=no warnings in follow-up CLs Change-Id: If2ccb23878ee6cdffa004f95562ea6a24350e063 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427094 Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--include/common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index 8ba86d7454..cd586465cf 100644
--- a/include/common.h
+++ b/include/common.h
@@ -15,6 +15,7 @@
#ifdef CONFIG_ZEPHYR
#include <sys/util.h>
+#include <toolchain.h>
#endif
/*
@@ -40,8 +41,10 @@
* Compared to directly using the preprocessor # operator, this 2-stage macro
* is safe with regards to using nested macros and defined arguments.
*/
+#ifndef CONFIG_ZEPHYR
#define STRINGIFY0(name) #name
#define STRINGIFY(name) STRINGIFY0(name)
+#endif /* CONFIG_ZEPHYR */
/* Macros to access registers */
#define REG64_ADDR(addr) ((volatile uint64_t *)(addr))