Commit 167c5f80 authored by Yann Gautier's avatar Yann Gautier
Browse files

utils: Add BIT_32 and BIT_64 macros



When applying some MISRA rules, lots of issues are raised with BIT macro
on AARCH32, and cast on uint32_t would be required (Rule 10.3).
The macros BIT_32 and BIT_64 are then created for 32bit and 64bit.
Then the BIT macro defaults on BIT_64 on AARCH64,
and on BIT_32 on AARCH32.
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
parent 39676357
...@@ -16,7 +16,14 @@ ...@@ -16,7 +16,14 @@
#define SIZE_FROM_LOG2_WORDS(n) (4 << (n)) #define SIZE_FROM_LOG2_WORDS(n) (4 << (n))
#define BIT(nr) (ULL(1) << (nr)) #define BIT_32(nr) (U(1) << (nr))
#define BIT_64(nr) (ULL(1) << (nr))
#ifdef AARCH32
#define BIT BIT_32
#else
#define BIT BIT_64
#endif
/* /*
* Create a contiguous bitmask starting at bit position @l and ending at * Create a contiguous bitmask starting at bit position @l and ending at
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment