mirror of https://github.com/thesofproject/sof.git
Merge pull request #610 from lbetlej/fix_in_set_bits_macro
Fixes for macros used for bit masks creation.
This commit is contained in:
commit
b0e3dbd5b4
|
@ -32,9 +32,10 @@
|
|||
#define __INCLUDE_BIT__
|
||||
|
||||
#define BIT(b) (1 << (b))
|
||||
#define MASK(b_hi, b_lo) ((1 << ((b_hi) - (b_lo) + 1)) - 1)
|
||||
#define MASK(b_hi, b_lo) \
|
||||
(((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL) << (b_lo))
|
||||
#define SET_BIT(b, x) (((x) & 1) << (b))
|
||||
#define SET_BITS(b_hi, b_lo, x) \
|
||||
(((x) & ((1 << ((b_hi) - (b_lo) + 1)) - 1)) << (b_lo))
|
||||
(((x) & ((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL)) << (b_lo))
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue