Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

bits.h File Reference

Go to the source code of this file.

Defines

#define ADDR   (*(volatile long *) addr)

Functions

__inline__ int TLSF_ffs (int x)
__inline__ int TLSF_fls (int x)
__inline__ void __clear_bit (int nr, volatile void *addr)


Define Documentation

#define ADDR   (*(volatile long *) addr)
 

Definition at line 11 of file i386/bits.h.


Function Documentation

__inline__ void __clear_bit int  nr,
volatile void *  addr
[static]
 

__clear_bit - Clears a bit in memory : Bit to clear : Address to start counting from

clear_bit() is non-atomic and may be reordered. However, it does not contain a memory barrier, so if it is used for locking purposes, you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit() in order to ensure changes are visible on other processors.

Definition at line 82 of file i386/bits.h.

References ADDR.

00083 {
00084         __asm__ __volatile__( 
00085                 "btrl %1,%0"
00086                 :"=m" (ADDR)
00087                 :"Ir" (nr));
00088 }

__inline__ int TLSF_ffs int  x  )  [static]
 

ffs - find first bit set : the word to search

This is defined the same way as the libc and compiler builtin ffs routines, therefore differs in spirit from the above ffz (man ffs).

Definition at line 23 of file i386/bits.h.

00024 {
00025         int r;
00026 
00027         __asm__("bsfl %1,%0\n\t"
00028                 "jnz 1f\n\t"
00029                 "movl $-1,%0\n"
00030                 "1:" : "=r" (r) : "g" (x));
00031         return r;
00032 }

__inline__ int TLSF_fls int  x  )  [static]
 

fls - find last bit set : the word to search

This is defined the same way as the libc and compiler builtin ffs routines, therefore differs in spirit from the above ffz (man ffs).

Definition at line 43 of file i386/bits.h.

Referenced by log2size(), and rtl_malloc_ex().

00044 {
00045         int r;
00046 
00047         __asm__("bsrl %1,%0\n\t"
00048                 "jnz 1f\n\t"
00049                 "movl $-1,%0\n"
00050                 "1:" : "=r" (r) : "g" (x));
00051         return r;
00052 }


Generated on Wed Jan 14 12:59:01 2004 for RTL-lwIP-0.4 by doxygen 1.3.4