Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ASM_GENERIC_BITS_PER_LONG
0003 #define __ASM_GENERIC_BITS_PER_LONG
0004 
0005 #include <uapi/asm-generic/bitsperlong.h>
0006 
0007 #ifdef __SIZEOF_LONG__
0008 #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
0009 #else
0010 #define BITS_PER_LONG __WORDSIZE
0011 #endif
0012 
0013 #if BITS_PER_LONG != __BITS_PER_LONG
0014 #error Inconsistent word size. Check asm/bitsperlong.h
0015 #endif
0016 
0017 #ifndef BITS_PER_LONG_LONG
0018 #define BITS_PER_LONG_LONG 64
0019 #endif
0020 
0021 #define small_const_nbits(nbits) \
0022     (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0)
0023 
0024 #endif /* __ASM_GENERIC_BITS_PER_LONG */