Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ffs.h File Reference
#include <zephyr/types.h>

Go to the source code of this file.

Functions

static ALWAYS_INLINE unsigned int find_msb_set (uint32_t op)
 find most significant bit set in a 32-bit word
 
static ALWAYS_INLINE unsigned int find_lsb_set (uint32_t op)
 find least significant bit set in a 32-bit word
 

Function Documentation

◆ find_lsb_set()

static ALWAYS_INLINE unsigned int find_lsb_set ( uint32_t op)
static

find least significant bit set in a 32-bit word

This routine finds the first bit set starting from the least significant bit in the argument passed in and returns the index of that bit. Bits are numbered starting at 1 from the least significant bit. A return value of zero indicates that the value passed is zero.

Returns
least significant bit set, 0 if op is 0

◆ find_msb_set()

static ALWAYS_INLINE unsigned int find_msb_set ( uint32_t op)
static

find most significant bit set in a 32-bit word

This routine finds the first bit set starting from the most significant bit in the argument passed in and returns the index of that bit. Bits are numbered starting at 1 from the least significant bit. A return value of zero indicates that the value passed is zero.

Returns
most significant bit set, 0 if op is 0