~ubuntu-branches/ubuntu/wily/numactl/wily

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