[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function



Hi Rahul,

On 08/01/2021 14:46, Rahul Singh wrote:
Implement the ffsll based on built-in function "__builtin_ffsll()"

ffsll will return one plus the index of the least significant 1-bit in
doublewords or if doublewords is zero, returns zero.

Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
---
Changes in V4:
  - This patch is introduce in this verison.
---
  xen/include/asm-arm/bitops.h | 12 ++++++++++++
  1 file changed, 12 insertions(+)

diff --git a/xen/include/asm-arm/bitops.h b/xen/include/asm-arm/bitops.h
index 71ae14cab3..7f83ee1828 100644
--- a/xen/include/asm-arm/bitops.h
+++ b/xen/include/asm-arm/bitops.h
@@ -170,6 +170,18 @@ static inline unsigned int find_first_set_bit(unsigned 
long word)
          return ffsl(word) - 1;
  }
+/**
+ * ffsll - find the first least significant set bit
+ * @doubleword: double word to search
+ *
+ * Returns one plus the index of the least significant 1-bit in @doubleword
+ * or if doubleword is zero, returns zero.
+ */
+static inline int ffsll(long long doubleword)

If I am not mistaken, we already have an helper doing exactly the same (see ffs64() in xen/bitops.h).

Can you check if it is effectively the case and use it?

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.