diff options
author | Tom Hughes <tomhughes@chromium.org> | 2020-11-24 16:41:00 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-28 16:16:22 +0000 |
commit | b2c1896d4e608f8dd9aeb0f61b1bc2cb2554dac8 (patch) | |
tree | 3aca6b916b9738ea57f19be185de32d9a2a20608 | |
parent | 57b4c76c13ad82c72aeae01ce67d8658fd81f214 (diff) | |
download | chrome-ec-b2c1896d4e608f8dd9aeb0f61b1bc2cb2554dac8.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>
-rw-r--r-- | include/ec_commands.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 5c19196b2e..94edd18db4 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 /* |