Subversion Repositories Kolibri OS

Rev

Rev 5056 | Rev 6082 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5056 Rev 5270
Line 16... Line 16...
16
/*
16
/*
17
 * Create a contiguous bitmask starting at bit position @l and ending at
17
 * Create a contiguous bitmask starting at bit position @l and ending at
18
 * position @h. For example
18
 * position @h. For example
19
 * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
19
 * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
20
 */
20
 */
-
 
21
#define GENMASK(h, l) \
21
#define GENMASK(h, l)		(((U32_C(1) << ((h) - (l) + 1)) - 1) << (l))
22
	(((~0UL) << (l)) & (~0UL >> (BITS_PER_LONG - 1 - (h))))
-
 
23
 
-
 
24
#define GENMASK_ULL(h, l) \
22
#define GENMASK_ULL(h, l)	(((U64_C(1) << ((h) - (l) + 1)) - 1) << (l))
25
	(((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h))))
Line 23... Line 26...
23
 
26
 
24
extern unsigned int __sw_hweight8(unsigned int w);
27
extern unsigned int __sw_hweight8(unsigned int w);
25
extern unsigned int __sw_hweight16(unsigned int w);
28
extern unsigned int __sw_hweight16(unsigned int w);
26
extern unsigned int __sw_hweight32(unsigned int w);
29
extern unsigned int __sw_hweight32(unsigned int w);