aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/bitops
diff options
context:
space:
mode:
authorAkinobu Mita <mita@miraclelinux.com>2006-03-26 04:39:13 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:11 -0500
commit3b9ed1a5d2d121f32d2cb4f2b05f1fc57c99c946 (patch)
treed8ea52d6b490c0e3b3851e1887c01700cc0115c6 /include/asm-generic/bitops
parent09020adb61416c4307de35941a9725a5e33d9beb (diff)
[PATCH] bitops: generic hweight{64,32,16,8}()
This patch introduces the C-language equivalents of the functions below: unsigned int hweight32(unsigned int w); unsigned int hweight16(unsigned int w); unsigned int hweight8(unsigned int w); unsigned long hweight64(__u64 w); In include/asm-generic/bitops/hweight.h This code largely copied from: include/linux/bitops.h Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-generic/bitops')
-rw-r--r--include/asm-generic/bitops/hweight.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/bitops/hweight.h b/include/asm-generic/bitops/hweight.h
new file mode 100644
index 000000000000..8be6f17d6a5c
--- /dev/null
+++ b/include/asm-generic/bitops/hweight.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_
2#define _ASM_GENERIC_BITOPS_HWEIGHT_H_
3
4extern unsigned int hweight32(unsigned int w);
5extern unsigned int hweight16(unsigned int w);
6extern unsigned int hweight8(unsigned int w);
7extern unsigned long hweight64(__u64 w);
8
9#endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */