59 #define TISCI_BIT(n) (((uint32_t) 1U) << (n)) 62 static inline uint32_t
get_field(uint32_t val, uint32_t end, uint32_t start);
63 static inline uint32_t
set_field(uint32_t tgt, uint32_t end, uint32_t start, uint32_t val);
64 static inline uint32_t
get_mask(uint32_t end, uint32_t start);
78 static inline uint32_t
get_mask(uint32_t end, uint32_t start)
80 return ((1U << (end - start + 1)) - 1U) << start;
92 static inline uint32_t
get_field(uint32_t val, uint32_t end, uint32_t start)
94 uint32_t mask =
get_mask(end, start);
96 return (val & mask) >> start;
110 static inline uint32_t
set_field(uint32_t tgt, uint32_t end, uint32_t start, uint32_t val)
113 uint32_t mask =
get_mask(end, start);
115 ret = (tgt & (~mask));
117 ret = (ret | ((val << start) & mask));
static uint32_t get_mask(uint32_t end, uint32_t start)
Generate a mask for the give bit field [end:start].
Definition: tisci_bitops.h:78
static uint32_t get_field(uint32_t val, uint32_t end, uint32_t start)
extract the specified bit field from a 32 bit unsigned integer.
Definition: tisci_bitops.h:92
static uint32_t set_field(uint32_t tgt, uint32_t end, uint32_t start, uint32_t val)
set the specified bit field from a 32 bit unsigned integer to provided value
Definition: tisci_bitops.h:110