Macros
BitFields.h File Reference
#include <sys/param.h>
#include <endian.h>

Go to the source code of this file.

Macros

#define SWAB32(word)   (word)
 
#define SWAB64(word)   (word)
 
#define BITFIELDGET(block, mask, shift)   ((SWAB32(block )& mask) >> shift)
 
#define BITFIELDSET(block, data, mask, shift)   block = SWAB32((SWAB32(block) & ~mask)| ((data << shift ) & mask))
 

Macro Definition Documentation

#define BITFIELDGET (   block,
  mask,
  shift 
)    ((SWAB32(block )& mask) >> shift)
#define BITFIELDSET (   block,
  data,
  mask,
  shift 
)    block = SWAB32((SWAB32(block) & ~mask)| ((data << shift ) & mask))
#define SWAB32 (   word)    (word)
#define SWAB64 (   word)    (word)

Definition at line 15 of file BitFields.h.