diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-02-03 18:40:05 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-02-03 18:40:05 -0800 |
| commit | 29d82b14a433fcba36b7cc062271225976355eaf (patch) | |
| tree | dde75472f3e859833e66e9ebbdcf65794a059a81 /include/linux/bitmap.h | |
| parent | bfff273c077ade79e08fe16138a5db3a7e89ef6b (diff) | |
[PATCH] bitmap parsing/printing routines, version 4
From: Joe Korty <joe.korty@ccur.com>
1) the version in 2.6.1 is broken, doesn't work on 64bit big endian
machines at all. This needed fixing. I thought it best to fix by
rewriting the printer/parser with an algorithm that is naturally endian &
sizeof(long) resistant.
2) I wanted all digits to print, eg, 0000ffff,00000004 not ffff,4.
3) I wanted exactly NR_CPUS bits to print (or whatever the bitmap size is
in bits, and not have what is displayed rounded up to the nearest full
byte, as the current version did.
4) The bitmap printer and parser should be part of bitmap.[ch] with syntax
and semantics to match. The original lib/mask.c versions did not
recognize this commonality.
Diffstat (limited to 'include/linux/bitmap.h')
| -rw-r--r-- | include/linux/bitmap.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index b84caaebed87..97fec37b1029 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -41,6 +41,10 @@ void bitmap_and(unsigned long *dst, const unsigned long *bitmap1, void bitmap_or(unsigned long *dst, const unsigned long *bitmap1, const unsigned long *bitmap2, int bits); int bitmap_weight(const unsigned long *bitmap, int bits); +int bitmap_snprintf(char *buf, unsigned int buflen, + const unsigned long *maskp, int bits); +int bitmap_parse(const char __user *ubuf, unsigned int ubuflen, + unsigned long *maskp, int bits); #endif /* __ASSEMBLY__ */ |
