summaryrefslogtreecommitdiff
path: root/libcpu/arm/cortex-a
diff options
context:
space:
mode:
authorMeco Jianting Man <[email protected]>2021-06-05 13:03:45 +0800
committerGitHub <[email protected]>2021-06-05 13:03:45 +0800
commitbfd8d21e388befc5d971075db5af0ed561abb4f2 (patch)
treed5caabadeb30fc67b3e0efa6dad251617639e096 /libcpu/arm/cortex-a
parent02331fd30d1f1ca8c886aac4db6c8c111987913c (diff)
parent28847008171ab7423b6b05b7157d3467f1525fda (diff)
Merge branch 'master' into mutexrevert
Diffstat (limited to 'libcpu/arm/cortex-a')
-rw-r--r--libcpu/arm/cortex-a/cpu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libcpu/arm/cortex-a/cpu.c b/libcpu/arm/cortex-a/cpu.c
index 7367bddd9f..c95c58a13c 100644
--- a/libcpu/arm/cortex-a/cpu.c
+++ b/libcpu/arm/cortex-a/cpu.c
@@ -75,4 +75,21 @@ RT_WEAK void rt_hw_cpu_shutdown()
}
}
+#ifdef RT_USING_CPU_FFS
+/**
+ * This function finds the first bit set (beginning with the least significant bit)
+ * in value and return the index of that bit.
+ *
+ * Bits are numbered starting at 1 (the least significant bit). A return value of
+ * zero from any of these functions means that the argument was zero.
+ *
+ * @return return the index of the first bit set. If value is 0, then this function
+ * shall return 0.
+ */
+int __rt_ffs(int value)
+{
+ return __builtin_ffs(value);
+}
+#endif
+
/*@}*/