MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / __rt_ffs

Function __rt_ffs

src/kservice.c:1093–1096  ·  view source on GitHub ↗

* @brief 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. * * @param value is the value to find the first bit set in. * * @return return the index of the first bi

Source from the content-addressed store, hash-verified

1091 * shall return 0.
1092 */
1093int __rt_ffs(int value)
1094{
1095 return __lowest_bit_bitmap[(rt_uint32_t)(value & (value - 1) ^ value) % 37];
1096}
1097#else
1098const rt_uint8_t __lowest_bit_bitmap[] =
1099{

Callers 10

ofw_device_renameFunction · 0.50
mmcsd_select_voltageFunction · 0.50
create_phy_by_maskFunction · 0.50
rt_phy_find_by_maskFunction · 0.50
gicv2_irq_set_affinityFunction · 0.50
_do_popFunction · 0.50
_get_unit_shiftFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected