On 07/02/2021 11:17, Jan Kiszka wrote:
> On 25.01.21 13:00, Andrea Bastoni wrote:
>> Signed-off-by: Andrea Bastoni <andrea.bast...@tum.de>
>> ---
>>  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.
>>      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);
> 
> 31? Something's fishy here.

Right, thanks.

-- 
Thanks,
Andrea Bastoni

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/11b93c4f-486b-2e4c-127d-9630aa020ef7%40tum.de.

Reply via email to