65 #define TISCI_BIT(n) (((uint32_t) 1U) << (n))
68 static inline uint32_t
get_field(uint32_t val, uint32_t end, uint32_t start);
69 static inline uint32_t
set_field(uint32_t tgt, uint32_t end, uint32_t start, uint32_t val);
70 static inline uint32_t
get_mask(uint32_t end, uint32_t start);
84 static inline uint32_t
get_mask(uint32_t end, uint32_t start)
86 return (uint32_t) ((1U << (end - start + 1U)) - 1U) << start;
98 static inline uint32_t
get_field(uint32_t val, uint32_t end, uint32_t start)
100 uint32_t mask =
get_mask(end, start);
102 return (val & mask) >> start;
116 static inline uint32_t
set_field(uint32_t tgt, uint32_t end, uint32_t start, uint32_t val)
119 uint32_t mask =
get_mask(end, start);
121 ret = (tgt & (~mask));
123 ret = (ret | ((val << start) & mask));