xref: /freebsd/sys/compat/linuxkpi/common/include/linux/bits.h (revision 47e1ca7f3720c76fdc729e03034fa53c798b9318)
1 /*
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2016 Kip Macy
5  * Copyright (c) 2018 Johannes Lundberg
6  */
7 
8 #ifndef _LINUXKPI_LINUX_BITS_H_
9 #define	_LINUXKPI_LINUX_BITS_H_
10 
11 #define	GENMASK(h, l)		(((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l)))
12 #define	GENMASK_ULL(h, l)	(((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l)))
13 
14 #endif /* _LINUXKPI_LINUX_BITS_H_ */
15