From 7055d8a555db976466243ac35fe1975c546952e2 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Thu, 10 Dec 2015 15:33:14 +0100 Subject: [PATCH] Allow to use bit mask in asm code --- u-boot/include/linux/bitops.h | 6 +++--- u-boot/include/soc/soc_common.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/u-boot/include/linux/bitops.h b/u-boot/include/linux/bitops.h index 6849219..c0cbd30 100755 --- a/u-boot/include/linux/bitops.h +++ b/u-boot/include/linux/bitops.h @@ -5,15 +5,15 @@ * Helper macros */ #define BIT(_x) (1 << (_x)) -#define BITS(_start, _bits) (((1UL << (_bits)) - 1) << _start) +#define BITS(_start, _bits) (((1 << (_bits)) - 1) << _start) #define CHECK_BIT(_var, _pos) ((_var) & (1 << (_pos))) +#ifndef __ASSEMBLY__ /* * 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). */ - static inline int generic_ffs(int x) { int r = 1; @@ -47,7 +47,6 @@ static inline int generic_ffs(int x) * hweightN: returns the hamming weight (i.e. the number * of bits set) of a N-bit word */ - static inline unsigned int generic_hweight32(unsigned int w) { unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); @@ -74,5 +73,6 @@ static inline unsigned int generic_hweight8(unsigned int w) #include +#endif /* !__ASSEMBLY__ */ #endif diff --git a/u-boot/include/soc/soc_common.h b/u-boot/include/soc/soc_common.h index 6dfea09..ec6aecc 100644 --- a/u-boot/include/soc/soc_common.h +++ b/u-boot/include/soc/soc_common.h @@ -9,9 +9,7 @@ #ifndef _SOC_COMMON_H_ #define _SOC_COMMON_H_ -#ifndef __ASSEMBLY__ #include -#endif /* !__ASSEMBLY__ */ #ifndef SOC_TYPE #error "SOC_TYPE is not defined!" -- 2.25.1