From e2d48f53354d613f0e67298a65a9bda2f1a0ab24 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 19 May 2017 09:31:15 +0200 Subject: dpaa: Implement GENMASK() similar to Linux --- rtemsbsd/powerpc/include/linux/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtemsbsd/powerpc/include/linux/bitops.h b/rtemsbsd/powerpc/include/linux/bitops.h index 6bed2dfc..1348697c 100644 --- a/rtemsbsd/powerpc/include/linux/bitops.h +++ b/rtemsbsd/powerpc/include/linux/bitops.h @@ -45,7 +45,7 @@ #define BITS_TO_LONGS(n) howmany((n), BITS_PER_LONG) #define BIT_MASK(nr) (1UL << ((nr) & (BITS_PER_LONG - 1))) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -#define GENMASK(hi, lo) (((2UL << ((hi) - (lo))) - 1UL) << (lo)) +#define GENMASK(hi, lo) (((~0UL) << (lo)) & (~0UL >> (BITS_PER_LONG - 1 - (hi)))) #define BITS_PER_BYTE 8 static inline int -- cgit v1.2.3