summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2017-11-07 13:54:06 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-16 23:32:11 -0800
commit2590ce95385346b27366b4bce22e71d87c54eaa6 (patch)
tree6214a5d945ccdb27fa1423119eaf22944797cf36 /core
parent26090a142b922dfe728a24241b60d47c50112b15 (diff)
downloadchrome-ec-2590ce95385346b27366b4bce22e71d87c54eaa6.tar.gz
common: Add software CTZ implementation when needeed
CTZ - Count Trailing Zero - is not implemented in hardware on cortex0 or nds32. Used in ST sensor drivers. BUG=none BRANCH=none TEST=compile Change-Id: I2d62fd60f05169189b24ba2a3308bec69ed9de9c Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/767609 Commit-Ready: Ely Vazquez <nadia198877@gmail.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m0/config_core.h3
-rw-r--r--core/nds32/config_core.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/core/cortex-m0/config_core.h b/core/cortex-m0/config_core.h
index e58b481704..389ed8edec 100644
--- a/core/cortex-m0/config_core.h
+++ b/core/cortex-m0/config_core.h
@@ -10,8 +10,9 @@
#define BFD_ARCH arm
#define BFD_FORMAT "elf32-littlearm"
-/* Emulate the CLZ instruction since the CPU core is lacking support */
+/* Emulate the CLZ/CTZ instructions since the CPU core is lacking support */
#define CONFIG_SOFTWARE_CLZ
+#define CONFIG_SOFTWARE_CTZ
#define CONFIG_SOFTWARE_PANIC
#endif /* __CROS_EC_CONFIG_CORE_H */
diff --git a/core/nds32/config_core.h b/core/nds32/config_core.h
index fae914f7eb..9e9a88848c 100644
--- a/core/nds32/config_core.h
+++ b/core/nds32/config_core.h
@@ -13,9 +13,10 @@
#define CONFIG_SOFTWARE_PANIC
/*
- * The Andestar v3m architecture has no CLZ instruction (contrary to v3),
+ * The Andestar v3m architecture has no CLZ/CTZ instructions (contrary to v3),
* so let's use the software implementation.
*/
#define CONFIG_SOFTWARE_CLZ
+#define CONFIG_SOFTWARE_CTZ
#endif /* __CROS_EC_CONFIG_CORE_H */