File: bitops.h

package info (click to toggle)
numactl 2.0.8~rc4-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 784 kB
  • sloc: ansic: 5,765; sh: 363; makefile: 150; perl: 59
file content (13 lines) | stat: -rwxr-xr-x 432 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef BITOPS_H
#define BITOPS_H 1

#define BITS_PER_LONG (sizeof(unsigned long) * 8)
#define BYTES_PER_LONG (sizeof(long))

#define test_bit(i,p)  ((p)[(i) / BITS_PER_LONG] &   (1UL << ((i)%BITS_PER_LONG)))
#define set_bit(i,p)   ((p)[(i) / BITS_PER_LONG] |=  (1UL << ((i)%BITS_PER_LONG)))
#define clear_bit(i,p) ((p)[(i) / BITS_PER_LONG] &= ~(1UL << ((i)%BITS_PER_LONG)))

extern int find_first_bit(void *mask, int max);

#endif