-
- Downloads
xen/bitops: put __ffs() into linux compatible header
The mentioned macros exist only because of Linux compatible purpose. The patch defines __ffs() in terms of Xen bitops and it is safe to define in this way ( as __ffs() - 1 ) as considering that __ffs() was defined as __builtin_ctzl(x), which has undefined behavior when x=0, so it is assumed that such cases are not encountered in the current code. To not include <xen/linux-compat.h> to Xen library files __ffs() and __ffz() were defined locally in find-next-bit.c. Except __ffs() usage in find-next-bit.c only one usage of __ffs() leave in smmu-v3.c. It seems that it __ffs can be changed to ffsl(x)-1 in this file, but to keep smmu-v3.c looks close to linux it was deciced just to define __ffs() in xen/linux-compat.h and include it in smmu-v3.c Signed-off-by:Oleksii Kurochko <oleksii.kurochko@gmail.com> Acked-by:
Shawn Anastasio <sanastasio@raptorengineering.com> Reviewed-by:
Jan Beulich <jbeulich@suse.com> Acked-by:
Michal Orzel <michal.orzel@amd.com> Acked-by:
Rahul Singh <rahul.singh@arm.com>
Showing
- xen/arch/arm/include/asm/arm64/bitops.h 0 additions, 21 deletionsxen/arch/arm/include/asm/arm64/bitops.h
- xen/arch/ppc/include/asm/bitops.h 0 additions, 21 deletionsxen/arch/ppc/include/asm/bitops.h
- xen/drivers/passthrough/arm/smmu-v3.c 2 additions, 0 deletionsxen/drivers/passthrough/arm/smmu-v3.c
- xen/include/xen/linux-compat.h 2 additions, 0 deletionsxen/include/xen/linux-compat.h
- xen/lib/find-next-bit.c 3 additions, 0 deletionsxen/lib/find-next-bit.c
Loading
Please register or sign in to comment