Skip to contentSkip to conversation

xen: Add generic implementation of binary search

PATCH Superseded Shanker Donthineni 1 participant 1 message Jul 15, 2016

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 xen: Add generic implementation of binary search

This patch adds the generic implementation of binary search algorithm whcih is copied from Linux kernel v4.7-rc7. No functional changes.

---
 xen/common/Makefile       |  1 +
 xen/common/bsearch.c      | 51 +++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/bsearch.h |  9 +++++++++
 3 files changed, 61 insertions(+)
 create mode 100644 xen/common/bsearch.c
 create mode 100644 xen/include/xen/bsearch.h
xen/common/Makefile +1 -0
index dbf00c6..f8123c2 100644
@@ -43,6 +43,7 @@ obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += sort.o
+obj-y += bsearch.o
 obj-y += smp.o
 obj-y += spinlock.o
 obj-y += stop_machine.o
xen/common/bsearch.c new file +51 -0

51 lines not on this page · raw message

xen/include/xen/bsearch.h new file +9 -0
new file mode 100644
index 0000000..07cf604
@@ -0,0 +1,9 @@
+#ifndef __XEN_BSEARCH_H__
+#define __XEN_BSEARCH_H__
+
+#include <xen/types.h>
+
+void *bsearch(const void *key, const void *base, size_t num, size_t size,
+	      int (*cmp)(const void *key, const void *elt));
+
+#endif /* __XEN_BSEARCH_H__ */
Signature · 8 lines
Qualcomm Datacenter Technologies, Inc. on behalf of the Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel