return k;
}
-/*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x) generic_ffs(x)
-
/*
* hweightN: returns the hamming weight (i.e. the number
* of bits set) of a N-bit word
mask = 1 << (nr & 0x1f);
*a |= mask;
}
-#define __set_bit
+#define PLATFORM__SET_BIT
/*
* clear_bit() doesn't provide any barrier for the compiler.
return result + ffz(tmp);
}
-/*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x) generic_ffs(x)
-
/*
* hweightN: returns the hamming weight (i.e. the number
* of bits set) of a N-bit word
"1:" : "=r" (r) : "g" (x));
return r+1;
}
-#define ffs
+#define PLATFORM_FFS
/**
* hweightN - returns the hamming weight of a N-bit word
return r;
}
#define __ffs(x) (ffs(x) - 1)
-#define ffs
+#define PLATFORM_FFS
#endif /* __KERNEL__ */
extern void clear_bit(int nr, volatile void * addr);
#define __clear_bit(nr, addr) clear_bit(nr, addr)
+#define PLATFORM__CLEAR_BIT
extern void change_bit(int nr, volatile void * addr);
extern void __change_bit(int nr, volatile void * addr);
mask = 1 << (nr & 0x1f);
*a |= mask;
}
-#define __set_bit
+#define PLATFORM__SET_BIT
/*
* clear_bit() doesn't provide any barrier for the compiler.
*m |= 1UL << (nr & 31);
}
-#define __set_bit
+#define PLATFORM__SET_BIT
/*
* clear_bit - Clears a bit in memory
#ifdef __KERNEL__
-/**
- * ffs - find first bit set
- * @x: the word to search
- *
- * This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
-#define ffs(x) generic_ffs(x)
-
/*
* hweightN - returns the hamming weight of a N-bit word
* @x: the word to weigh
extern int test_and_change_bit(int nr, volatile void * addr);
extern int test_bit(int nr, volatile void * a);
extern int ffs(int i);
-#define ffs
+#define PLATFORM_FFS
#endif /* _ASM_NIOS_BITOPS_H */
extern int test_and_change_bit(int nr, volatile void * addr);
extern int test_bit(int nr, volatile void * a);
extern int ffs(int i);
-#define ffs
+#define PLATFORM_FFS
#endif /* __ASM_NIOS2_BITOPS_H */
{
return __ilog2(x) + 1;
}
-#define fls
+#define PLATFORM_FLS
/**
* fls64 - find last set bit in a 64-bit word
{
return __ilog2(x & -x) + 1;
}
-#define ffs
+#define PLATFORM_FFS
/*
* hweightN: returns the hamming weight (i.e. the number
}
return r;
}
-#define ffs
+#define PLATFORM_FFS
#endif /* __KERNEL__ */
/* linux/include/asm-generic/bitops/non-atomic.h */
-#ifndef __set_bit
+#ifndef PLATFORM__SET_BIT
# define __set_bit generic_set_bit
#endif
-#ifndef __clear_bit
+#ifndef PLATFORM__CLEAR_BIT
# define __clear_bit generic_clear_bit
#endif
-#ifndef ffs
+#ifndef PLATFORM_FFS
# define ffs generic_ffs
#endif
-#ifndef fls
+#ifndef PLATFORM_FLS
# define fls generic_fls
#endif