From b2c1896d4e608f8dd9aeb0f61b1bc2cb2554dac8 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 24 Nov 2020 16:41:00 -0800 Subject: 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 Change-Id: I439b0d77c47f3921f7bf2afd04c62cc72d668ea6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558857 Reviewed-by: Keith Short Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2600802 Tested-by: David Huang Auto-Submit: David Huang Commit-Queue: Keith Short --- include/ec_commands.h | 6 ++++++ 1 file changed, 6 insertions(+) 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 /* -- cgit v1.2.1