Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
db1f39b6
Unverified
Commit
db1f39b6
authored
6 years ago
by
Dimitris Papastamos
Committed by
GitHub
6 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1422 from Yann-lms/genmask
Genmask
parents
1ebdbe79
167c5f80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/lib/utils_def.h
+25
-1
include/lib/utils_def.h
with
25 additions
and
1 deletion
+25
-1
include/lib/utils_def.h
View file @
db1f39b6
...
...
@@ -16,7 +16,31 @@
#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
* position @h. For example
* GENMASK_64(39, 21) gives us the 64bit vector 0x000000ffffe00000.
*/
#define GENMASK_32(h, l) \
(((~UINT32_C(0)) << (l)) & (~UINT32_C(0) >> (32 - 1 - (h))))
#define GENMASK_64(h, l) \
(((~UINT64_C(0)) << (l)) & (~UINT64_C(0) >> (64 - 1 - (h))))
#ifdef AARCH32
#define GENMASK GENMASK_32
#else
#define GENMASK GENMASK_64
#endif
/*
* This variant of div_round_up can be used in macro definition but should not
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help