Skip to content

Commit

Permalink
linux/const.h: Add _BITUL() and _BITULL()
Browse files Browse the repository at this point in the history
Add macros for single bit definitions of a specific type.  These are
similar to the BIT() macro that already exists, but with a few
exceptions:

1. The namespace is such that they can be used in uapi definitions.
2. The type is set with the _AC() macro to allow it to be used in
   assembly.
3. The type is explicitly specified to be UL or ULL.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/n/tip-nbca8p7cg6jyjoit7klh3o91@git.kernel.org
  • Loading branch information
H. Peter Anvin committed Jun 25, 2013
1 parent f07d91e commit 2fc016c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/uapi/linux/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@
#define _AT(T,X) ((T)(X))
#endif

#define _BITUL(x) (_AC(1,UL) << (x))
#define _BITULL(x) (_AC(1,ULL) << (x))

#endif /* !(_LINUX_CONST_H) */

0 comments on commit 2fc016c

Please sign in to comment.