axa 3.0.1
Farsight Security Advanced Exchange Access (AXA)
axa_bits

Detailed Description

axa_bits contains bitwise macros and function declarations for libaxa.

Data Structures

struct  axa_ch_mask_t
 an AXA channel mask More...
 

Macros

#define AXA_WORD_BITS   (sizeof(axa_word_t)*8)
 AXA word size in bits.
 
#define BYTES_TO_AXA_WORDS(b)
 Convert bytes to number of AXA words.
 
#define AXA_WORDS_TO_BYTES(w)   ((w)*sizeof(axa_word_t))
 Convert AXA words to number of bytes.
 
#define BITS_TO_AXA_WORDS(b)   (((b) + AXA_WORD_BITS-1) / AXA_WORD_BITS)
 Convert bits to number of AXA words.
 
#define axa_fls_word(w)
 Find the index of the most significant non-zero bit in a 64-bit word by counting its leading zeros.
 
#define AXA_NMSG_CH_MAX   255
 the largest SIE channel
 

Typedefs

typedef uint64_t axa_word_t
 an AXA word is 64 unsigned bits
 

Functions

uint axa_find_bitwords (axa_word_t *w, uint bits_len)
 Find the index of the first bit set in an array of 64-bit words.
 

Macro Definition Documentation

◆ AXA_WORD_BITS

#define AXA_WORD_BITS   (sizeof(axa_word_t)*8)

AXA word size in bits.

◆ BYTES_TO_AXA_WORDS

#define BYTES_TO_AXA_WORDS (   b)
Value:
(((b)+sizeof(axa_word_t)-1) \
/ sizeof(axa_word_t))

Convert bytes to number of AXA words.

Parameters
[in]bnumber of bytes
Returns
number of AXA words

◆ AXA_WORDS_TO_BYTES

#define AXA_WORDS_TO_BYTES (   w)    ((w)*sizeof(axa_word_t))

Convert AXA words to number of bytes.

Parameters
[in]wnumber of AXA words
Returns
number of bytes

◆ BITS_TO_AXA_WORDS

#define BITS_TO_AXA_WORDS (   b)    (((b) + AXA_WORD_BITS-1) / AXA_WORD_BITS)

Convert bits to number of AXA words.

Parameters
[in]bnumber of bits
Returns
number of AXA words

◆ axa_fls_word

#define axa_fls_word (   w)
Value:
(((w) == 0) ? (uint)AXA_WORD_BITS \
: (uint)__builtin_clzll((axa_word_t)(w)))

Find the index of the most significant non-zero bit in a 64-bit word by counting its leading zeros.

Parameters
[in]wAXA word
Returns
the index of the MSB or 64 if the word is 0

◆ AXA_NMSG_CH_MAX

#define AXA_NMSG_CH_MAX   255

the largest SIE channel

Typedef Documentation

◆ axa_word_t

typedef uint64_t axa_word_t

an AXA word is 64 unsigned bits

Function Documentation

◆ axa_find_bitwords()

uint axa_find_bitwords ( axa_word_t w,
uint  bits_len 
)

Find the index of the first bit set in an array of 64-bit words.

Parameters
[in]wpointer to an AXA word
[in]bits_lenlength of bits
Returns
index of the first bit set or bits_len * 64 if no bits are set