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

[Minios-devel] [UNIKRAFT PATCH] include/uk/arch: Rename ukarch_find_lsbit to ukarch_ffsl


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 2 Aug 2018 11:32:04 +0300
  • Cc: florian.schmidt@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, yuri.volchkov@xxxxxxxxx
  • Delivery-date: Thu, 02 Aug 2018 08:32:17 +0000
  • Ironport-phdr: 9a23:1e9lNhVH17LDHFr/EqOlRnLM6OPV8LGtZVwlr6E/grcLSJyIuqrYbReHt8tkgFKBZ4jH8fUM07OQ7/i+HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba9zIRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmijoINyQh/W/XlMJ+kaxVrhGmqRFk34LYfJuYOOZkc6/BYd8XQ3dKUMZLVyxGB4Oxd5UCD+0aPeZEron9oUYFox2jBQm0GePk1zhFiWPx3a0hz+QhEAfG0BYkH9ITqHTUsc74O7sJUeyv1KnI0C7MY+lM2Tf68YXFdA0qr/KUXb9obMbcxlQjGxnGg1iQs4DpIS2Z2+YXv2WV9+ZsSO2ih3M9pwxyojWj3Nkgh4fHi44P11zJ+jt1zYAoLtOiUkF7e8SrEJ5IuiGfMIt5X90tTnlzuCY/1r0GoZm7fDUWyJg/xx7QdfiHc4+Q7xL9UeaeOzZ4hHZ/dL2jnBa+61CgyvDnWcWuylZKqTJJktjKtn8Tyxze8tWLR/Rg8ku72juC1xrf5v9aLU02j6bWJYYtwrsqmZoStUTDEDX2mELzjKKOakok/fOo6/jmYrXgvJOcM5J0ihnjMqk1hsO/Gv40MhATX2eA4+i8zrrj8VXjQLpWlv02jrXZsJfCKMQep665BQ5V0oE46xqmEjipzsoYkmcDLF9efBKHjpPpO03VIPziAvawnVKsnC1sx/DcMb3rGo/NIWTbkLf9YbZ97FZRyAQ3zdBY/ZJUC6sOIPTpVk/qqNPYDho5Mw2pzOb7E9h90J0RVn6LAqCDK6zeq0GH5v83KemWeIAVoCr9K+Qi5/P2ln85mFodfa6v3ZcNa3C4A+ppI0OYYHXymNcMCmEKsRQiQ+zuklKNSiRfaGivX6gk/DE0FJqmDZvfRoCqmLGA3Dq7HodXZmxcFFCMFnPoeJmEW/cPbyKSPNRskjoaWre9T48uzwqhuBXkxLp6faLo/XgdtJTi08Mw6+DNmBUa8T1vE9/bw2yLCWZukTAmXTgziYt4ulB8zB+nzLBly6hTEsdP5vUPVhoiKLbX1KpiFtq0QAWXLYTBc0qvXtjzWWJ5ddk22dJbO0s=
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

A common convention for functions that find first set bit is to be named
ffs. Keeping the old name would have brought confusion considering that
the function that finds last set bit is usually called fls. Last l in
the name stands for long.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 include/uk/arch/arm/atomic.h    | 4 ++--
 include/uk/arch/x86_64/atomic.h | 4 ++--
 lib/vfscore/fd.c                | 2 +-
 plat/xen/hypervisor.c           | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/uk/arch/arm/atomic.h b/include/uk/arch/arm/atomic.h
index 9d54eea..93ac986 100644
--- a/include/uk/arch/arm/atomic.h
+++ b/include/uk/arch/arm/atomic.h
@@ -32,12 +32,12 @@
 #endif
 
 /**
- * ukarch_find_lsbit - find first (lowest) set bit in word.
+ * ukarch_ffsl - find first (lowest) set bit in word.
  * @word: The word to search
  *
  * Undefined if no bit exists, so code should check against 0 first.
  */
-static inline unsigned long ukarch_find_lsbit(unsigned long word)
+static inline unsigned long ukarch_ffsl(unsigned long word)
 {
        int clz;
 
diff --git a/include/uk/arch/x86_64/atomic.h b/include/uk/arch/x86_64/atomic.h
index 985c388..c5f30cc 100644
--- a/include/uk/arch/x86_64/atomic.h
+++ b/include/uk/arch/x86_64/atomic.h
@@ -31,12 +31,12 @@
 #endif
 
 /**
- * ukarch_find_lsbit - find first (lowest) set bit in word.
+ * ukarch_ffsl - find first (lowest) set bit in word.
  * @word: The word to search
  *
  * Undefined if no bit exists, so code should check against 0 first.
  */
-static inline unsigned long ukarch_find_lsbit(unsigned long word)
+static inline unsigned long ukarch_ffsl(unsigned long word)
 {
        __asm__("bsfq %1,%0"
                :"=r" (word)
diff --git a/lib/vfscore/fd.c b/lib/vfscore/fd.c
index 865a37a..07a69b5 100644
--- a/lib/vfscore/fd.c
+++ b/lib/vfscore/fd.c
@@ -58,7 +58,7 @@ int vfscore_alloc_fd(void)
        int ret;
 
        flags = ukplat_lcpu_save_irqf();
-       ret = ukarch_find_lsbit(~fdtable.bitmap);
+       ret = ukarch_ffsl(~fdtable.bitmap);
 
        if (!ret) {
                ret = -ENFILE;
diff --git a/plat/xen/hypervisor.c b/plat/xen/hypervisor.c
index 4eca19d..ca16ed6 100644
--- a/plat/xen/hypervisor.c
+++ b/plat/xen/hypervisor.c
@@ -70,11 +70,11 @@ void do_hypervisor_callback(struct __regs *regs)
 #endif
        l1 = ukarch_exchange_n(&vcpu_info->evtchn_pending_sel, 0);
        while (l1 != 0) {
-               l1i = ukarch_find_lsbit(l1);
+               l1i = ukarch_ffsl(l1);
                l1 &= ~(1UL << l1i);
 
                while ((l2 = active_evtchns(cpu, s, l1i)) != 0) {
-                       l2i = ukarch_find_lsbit(l2);
+                       l2i = ukarch_ffsl(l2);
                        l2 &= ~(1UL << l2i);
 
                        port = (l1i * (sizeof(unsigned long) * 8)) + l2i;
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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