Skip to contentSkip to conversation

lib: add weak clz/ctz functions

PATCH RESEND New Chanho Min 1 participant 1 message May 7, 2013

Subsystems (2)
lore
Share & tools
lore

Chanho Min

author
#0 lore raw

PATCH RESEND 1/1 lib: add weak clz/ctz functions

Some architectures need __c[lt]z[sd]i2() for __builtin_c[lt]z[ll] and It causes build failure. They can be implemented using the fls()/__ffs() and overridden by linking arch-specific versions may not be implemented yet.

Reference: https://lkml.org/lkml/2013/4/18/603

---
 lib/Makefile  |    2 +-
 lib/clz_ctz.c |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 lib/clz_ctz.c
lib/Makefile +1 -1
index af79e8c..3eacb2c 100644
@@ -23,7 +23,7 @@ lib-y	+= kobject.o klist.o
 
 obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
 	 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
-	 gcd.o lcm.o list_sort.o uuid.o flex_array.o \
+	 gcd.o lcm.o list_sort.o uuid.o flex_array.o clz_ctz.o\
 	 bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o
 obj-y += string_helpers.o
 obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
lib/clz_ctz.c new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
1.7.9.5