summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index d82f74f4dd..b45fc44ecd 100644
--- a/include/common.h
+++ b/include/common.h
@@ -137,4 +137,7 @@ enum ec_error_list {
#define test_export_static static
#endif
+/* find the most significant bit. Not defined in n == 0. */
+#define __fls(n) (31 - __builtin_clz(n))
+
#endif /* __CROS_EC_COMMON_H */