File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1104,13 +1104,19 @@ RTM_EXPORT(rt_free_align);
11041104#endif /* RT_USING_HEAP */
11051105
11061106/**
1107- * fls - find last (most-significant) bit set
1108- * @x: the word to search
1107+ * @brief Find the index of the most significant set bit in a 32-bit integer.
1108+ * @details The result is the position of the highest bit set to 1, counting
1109+ * from 1 for the least significant bit. If the input value is 0, the function
1110+ * returns 0.
11091111 *
1110- * This is defined the same way as ffs.
1111- * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
1112+ * Examples:
1113+ * - fls(0) = 0
1114+ * - fls(1) = 1
1115+ * - fls(0x80000000) = 32
1116+ *
1117+ * @param val 32-bit integer value to examine.
1118+ * @return Position of the most significant set bit (1–32), or 0 if @p val is 0.
11121119 */
1113-
11141120int __rt_fls (int val )
11151121{
11161122 int bit = 32 ;
You can’t perform that action at this time.
0 commit comments