Hi Oleksii,
On 4/3/24 5:19 AM, Oleksii Kurochko wrote:
> 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
On 03.04.2024 12:19, Oleksii Kurochko wrote:
> --- a/xen/include/xen/linux-compat.h
> +++ b/xen/include/xen/linux-compat.h
> @@ -19,4 +19,6 @@ typedef int64_t __s64;
>
> typedef paddr_t phys_addr_t;
>
> +#define __ffs(x) (ffsl(x) - 1)
To be truly Linux-compatible, the result type would
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