/* SPDX-License-Identifier: GPL-2.0 */1#ifndef __ASM_GENERIC_BITS_PER_LONG2#define __ASM_GENERIC_BITS_PER_LONG34#include <uapi/asm-generic/bitsperlong.h>567#ifdef CONFIG_64BIT8#define BITS_PER_LONG 649#else10#define BITS_PER_LONG 3211#endif /* CONFIG_64BIT */1213/*14* FIXME: The check currently breaks x86-64 build, so it's15* temporarily disabled. Please fix x86-64 and reenable16*/17#if 0 && BITS_PER_LONG != __BITS_PER_LONG18#error Inconsistent word size. Check asm/bitsperlong.h19#endif2021#ifndef BITS_PER_LONG_LONG22#define BITS_PER_LONG_LONG 6423#endif2425/*26* small_const_nbits(n) is true precisely when it is known at compile-time27* that BITMAP_SIZE(n) is 1, i.e. 1 <= n <= BITS_PER_LONG. This allows28* various bit/bitmap APIs to provide a fast inline implementation. Bitmaps29* of size 0 are very rare, and a compile-time-known-size 0 is most likely30* a sign of error. They will be handled correctly by the bit/bitmap APIs,31* but using the out-of-line functions, so that the inline implementations32* can unconditionally dereference the pointer(s).33*/34#define small_const_nbits(nbits) \35(__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG && (nbits) > 0)3637#endif /* __ASM_GENERIC_BITS_PER_LONG */383940