summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-11-24 16:41:00 -0800
committerCommit Bot <commit-bot@chromium.org>2021-01-05 16:34:52 +0000
commit5831bff0db7ec07f01a9368803332ac0c5780caf (patch)
tree87be9fa2582a9d37520e54285a49aede3dd6e97c
parentd070e25c8a09bd5d56ad047445f86015108dbf59 (diff)
downloadchrome-ec-5831bff0db7ec07f01a9368803332ac0c5780caf.tar.gz
ec_commands: Add GENMASK macros
GENMASK is used in ec_commands.h, but is not defined if not compiling in kernel or Chrome OS EC environments. BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I439b0d77c47f3921f7bf2afd04c62cc72d668ea6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558857 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600802 Tested-by: David Huang <david.huang@quanta.corp-partner.google.com> Auto-Submit: David Huang <david.huang@quanta.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org> (cherry picked from commit b2c1896d4e608f8dd9aeb0f61b1bc2cb2554dac8) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607208
-rw-r--r--include/ec_commands.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 2ae24c4e7e..2883eb5eb6 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -23,6 +23,12 @@
#if !defined(__KERNEL__)
#include "compile_time_macros.h"
+#ifndef GENMASK
+#define GENMASK(h, l) (((BIT(h) << 1) - 1) ^ (BIT(l) - 1))
+#endif
+#ifndef GENMASK_ULL
+#define GENMASK_ULL(h, l) (((BIT_ULL(h) << 1) - 1) ^ (BIT_ULL(l) - 1))
+#endif
#endif
/*