bitops.h File Reference

Go to the source code of this file.

Functions

__inline__ int set_bit (int nr, int *addr)
__inline__ int clear_bit (int nr, int *addr)
__inline__ int test_bit (int nr, int *addr)


Function Documentation

__inline__ int clear_bit ( int  nr,
int *  addr 
)

Definition at line 105 of file bitops.h.

References cli, and sti.

__inline__ int set_bit ( int  nr,
int *  addr 
)

For the benefit of those who are trying to port Linux to another architecture, here are some C-language equivalents. You should recode these in the native assmebly language, if at all possible. To guarantee atomicity, these routines call cli() and sti() to disable interrupts while they operate. (You have to provide inline routines to cli() and sti().)

Also note, these routines assume that you have 32 bit integers. You will have to change this if you are trying to port Linux to the Alpha architecture or to a Cray. :-)

C language equivalents written by Theodore Ts'o, 9/26/92

Definition at line 92 of file bitops.h.

References cli, and sti.

__inline__ int test_bit ( int  nr,
int *  addr 
)

Definition at line 118 of file bitops.h.


Generated on Mon May 1 21:47:00 2006 for KernelAPI by  doxygen 1.4.6-5