|
@@ -3,8 +3,6 @@
|
|
#define _TOOLS_LINUX_BITOPS_H_
|
|
#define _TOOLS_LINUX_BITOPS_H_
|
|
|
|
|
|
#include <asm/types.h>
|
|
#include <asm/types.h>
|
|
-#include <linux/compiler.h>
|
|
|
|
-
|
|
|
|
#ifndef __WORDSIZE
|
|
#ifndef __WORDSIZE
|
|
#define __WORDSIZE (__SIZEOF_LONG__ * 8)
|
|
#define __WORDSIZE (__SIZEOF_LONG__ * 8)
|
|
#endif
|
|
#endif
|
|
@@ -12,10 +10,9 @@
|
|
#ifndef BITS_PER_LONG
|
|
#ifndef BITS_PER_LONG
|
|
# define BITS_PER_LONG __WORDSIZE
|
|
# define BITS_PER_LONG __WORDSIZE
|
|
#endif
|
|
#endif
|
|
|
|
+#include <linux/bits.h>
|
|
|
|
+#include <linux/compiler.h>
|
|
|
|
|
|
-#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
|
|
|
|
-#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
|
|
|
|
-#define BITS_PER_BYTE 8
|
|
|
|
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
|
|
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
|
|
#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64))
|
|
#define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64))
|
|
#define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32))
|
|
#define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32))
|