xen: Add generic implementation of binary search
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.
Signed-off-by Shanker Donthineni <[email protected]>
--- 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
@@ -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
@@ -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