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
TEST=make buildall
@@ -56,6 +56,14 @@ extern "C" {
#define BIT_ULL(nr) (1ULL << (nr))
#endif
+#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 /* __KERNEL__ */
/*
