1 | /* $Id: bitops.h 142 2000-04-23 14:55:46Z ktk $ */
|
---|
2 |
|
---|
3 | #ifndef _I386_BITOPS_H
|
---|
4 | #define _I386_BITOPS_H
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright 1992, Linus Torvalds.
|
---|
8 | */
|
---|
9 |
|
---|
10 | /*
|
---|
11 | * These have to be done with inline assembly: that way the bit-setting
|
---|
12 | * is guaranteed to be atomic. All bit operations return 0 if the bit
|
---|
13 | * was cleared before the operation and != 0 if it was not.
|
---|
14 | *
|
---|
15 | * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
|
---|
16 | */
|
---|
17 |
|
---|
18 | /*
|
---|
19 | * Function prototypes to keep gcc -Wall happy
|
---|
20 | */
|
---|
21 | extern void set_bit(int nr, volatile void * addr);
|
---|
22 | extern void clear_bit(int nr, volatile void * addr);
|
---|
23 | extern void change_bit(int nr, volatile void * addr);
|
---|
24 | extern int test_and_set_bit(int nr, volatile void * addr);
|
---|
25 | extern int test_and_clear_bit(int nr, volatile void * addr);
|
---|
26 | extern int test_and_change_bit(int nr, volatile void * addr);
|
---|
27 | extern int __constant_test_bit(int nr, const volatile void * addr);
|
---|
28 | extern int __test_bit(int nr, volatile void * addr);
|
---|
29 | extern int find_first_zero_bit(void * addr, unsigned size);
|
---|
30 | extern int find_next_zero_bit (void * addr, int size, int offset);
|
---|
31 | extern unsigned long ffz(unsigned long word);
|
---|
32 |
|
---|
33 | #endif /* _I386_BITOPS_H */
|
---|