|
@@ -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
|
|
|
+
|
|
|
/*@}*/
|