On 23.11.20 21:46, Andrea Bastoni wrote:
> Signed-off-by: Andrea Bastoni <[email protected]>
> ---
> hypervisor/arch/arm-common/include/asm/bitops.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/hypervisor/arch/arm-common/include/asm/bitops.h
> b/hypervisor/arch/arm-common/include/asm/bitops.h
> index 808c9a0f..a726862f 100644
> --- a/hypervisor/arch/arm-common/include/asm/bitops.h
> +++ b/hypervisor/arch/arm-common/include/asm/bitops.h
> @@ -31,6 +31,7 @@ static inline unsigned long clz(unsigned long word)
> /* Returns the position of the least significant 1, MSB=31, LSB=0*/
> static inline unsigned long ffsl(unsigned long word)
> {
> + // FIXME: the ffsl on x86 isn't robust.
Can you elaborate?
> if (!word)
> return 0;
> asm volatile ("rbit %0, %0" : "+r" (word));
> @@ -41,3 +42,12 @@ static inline unsigned long ffzl(unsigned long word)
> {
> return ffsl(~word);
> }
> +
> +static inline unsigned long msbl(unsigned long word)
> +{
> +#if BITS_PER_LONG == 64
> + return 63 - clz(word);
> +#else
> + return 32 - clz(word);
> +#endif
> +}
>
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/8f2b8fa9-a695-a845-b02f-98e22180b4ae%40siemens.com.