* [tip:x86/asm] linux/const.h: Add _BITUL() and _BITULL()
@ 2013-06-25 22:54 tip-bot for H. Peter Anvin
0 siblings, 0 replies; only message in thread
From: tip-bot for H. Peter Anvin @ 2013-06-25 22:54 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, hpa
Commit-ID: 2fc016c5bd8aad2e201cdf71b9fb4573f94775bd
Gitweb: http://git.kernel.org/tip/2fc016c5bd8aad2e201cdf71b9fb4573f94775bd
Author: H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Sat, 27 Apr 2013 16:07:49 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 25 Jun 2013 15:50:04 -0700
linux/const.h: Add _BITUL() and _BITULL()
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
---
include/uapi/linux/const.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h
index c22c707..c872bfd 100644
--- a/include/uapi/linux/const.h
+++ b/include/uapi/linux/const.h
@@ -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) */
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-06-25 22:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-25 22:54 [tip:x86/asm] linux/const.h: Add _BITUL() and _BITULL() tip-bot for H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox