GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EDS / V2-10-1 > ebfio / rad750
#include "EDS/impl/FFS.xx-xxx-xxx.h"
Functions | |
static __inline int | FFS (unsigned int word) |
Finds the first set bit (MSB = bit 0) in a 32-bit word. | |
static __inline unsigned int | FFS_eliminate (unsigned int word, int bit) |
Eliminates the specified bit, bit from word. | |
static __inline unsigned int | FFS_mask (int bit) |
Converts the bit to a bit mask. | |
static __inline unsigned int | FFS_insert (unsigned int word, int bit) |
Inserts the specified bit, bit into word. |
CVS $Id: FFS.h,v 1.3 2005/10/13 22:00:55 russell Exp $
int count_bits (unsigned int word) { int cnt = 0; while (word) { int bit; bit = FFS (word); cnt += 1; word = FFS_eliminate (word, bit); } return cnt; }
int FFS | ( | unsigned int | word | ) | [static] |
Finds the first set bit (MSB = bit 0) in a 32-bit word.
static __inline unsigned int FFS_eliminate | ( | unsigned int | word, | |
int | bit | |||
) | [static] |
Eliminates the specified bit, bit from word.
word | The word to eliminate the bit from | |
bit | The bit (MSB = 0) to eliminate |
int FFS_insert | ( | unsigned int | word, | |
int | bit | |||
) | [static] |
Inserts the specified bit, bit into word.
word | The word to insert the bit into | |
bit | The bit (MSB = 0) to add |
static __inline unsigned int FFS_mask | ( | int | bit | ) | [static] |
Converts the bit to a bit mask.
bit | The bit (MSB = 0) to set. |