source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/linux/bitmap.h

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 1.5 KB
RevLine 
[2]1#ifndef __LINUX_BITMAP_H
2#define __LINUX_BITMAP_H
3
4#ifndef __ASSEMBLY__
5
6#include <linux/types.h>
7#include <linux/bitops.h>
8
9int bitmap_empty(const unsigned long *bitmap, int bits);
10int bitmap_full(const unsigned long *bitmap, int bits);
11int bitmap_equal(const unsigned long *bitmap1,
12                        unsigned long *bitmap2, int bits);
13void bitmap_complement(unsigned long *bitmap, int bits);
14
15static inline void bitmap_zero(unsigned long *bitmap, int bits)
16{
17        memset(bitmap, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long));
18}
19
20static inline void bitmap_fill(unsigned long *bitmap, int bits)
21{
22        memset(bitmap, 0xff, BITS_TO_LONGS(bits)*sizeof(unsigned long));
23}
24
25static inline void bitmap_copy(unsigned long *dst,
26                        const unsigned long *src, int bits)
27{
28        int len = BITS_TO_LONGS(bits)*sizeof(unsigned long);
29        memcpy(dst, src, len);
30}
31
32void bitmap_shift_right(unsigned long *dst,
33                        const unsigned long *src, int shift, int bits);
34void bitmap_shift_left(unsigned long *dst,
35                        const unsigned long *src, int shift, int bits);
36void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
37                        const unsigned long *bitmap2, int bits);
38void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
39                        const unsigned long *bitmap2, int bits);
40int bitmap_weight(const unsigned long *bitmap, int bits);
41int bitmap_scnprintf(char *buf, unsigned int buflen,
42                        const unsigned long *maskp, int bits);
43int bitmap_parse(const char *ubuf, unsigned int ubuflen,
44                        unsigned long *maskp, int bits);
45
46#endif /* __ASSEMBLY__ */
47
48#endif /* __LINUX_BITMAP_H */
Note: See TracBrowser for help on using the repository browser.