Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
bitops.h File Reference
#include <asm/cpu-regs.h>
#include <asm-generic/bitops/lock.h>

Go to the source code of this file.

Macros

#define smp_mb__before_clear_bit()   barrier()
 
#define smp_mb__after_clear_bit()   barrier()
 
#define __set_bit(nr, addr)
 
#define set_bit(nr, addr)   __set_bit((nr), (addr))
 
#define ___clear_bit(nr, addr)
 
#define clear_bit(nr, addr)   ___clear_bit((nr), (addr))
 
#define __test_and_set_bit(nr, addr)
 
#define test_and_set_bit(nr, addr)   __test_and_set_bit((nr), (addr))
 
#define __test_and_clear_bit(nr, addr)
 
#define test_and_clear_bit(nr, addr)   __test_and_clear_bit((nr), (addr))
 

Functions

void change_bit (unsigned long nr, volatile void *addr)
 
int test_and_change_bit (unsigned long nr, volatile void *addr)
 

Macro Definition Documentation

#define ___clear_bit (   nr,
  addr 
)
Value:
({ \
volatile unsigned char *_a = (unsigned char *)(addr); \
const unsigned shift = (nr) & 7; \
_a += (nr) >> 3; \
\
asm volatile("bclr %2,(%1) # clear_bit reg" \
: "=m"(*_a) \
: "a"(_a), "d"(1 << shift), "m"(*_a) \
: "memory", "cc"); \
})

Definition at line 45 of file bitops.h.

#define __set_bit (   nr,
  addr 
)
Value:
({ \
volatile unsigned char *_a = (unsigned char *)(addr); \
const unsigned shift = (nr) & 7; \
_a += (nr) >> 3; \
\
asm volatile("bset %2,(%1) # set_bit reg" \
: "=m"(*_a) \
: "a"(_a), "d"(1 << shift), "m"(*_a) \
: "memory", "cc"); \
})

Definition at line 28 of file bitops.h.

#define __test_and_clear_bit (   nr,
  addr 
)
Value:
({ \
volatile unsigned char *_a = (unsigned char *)(addr); \
const unsigned shift = (nr) & 7; \
unsigned epsw; \
_a += (nr) >> 3; \
\
asm volatile("bclr %3,(%2) # test_clear_bit reg\n" \
"mov epsw,%1" \
: "=m"(*_a), "=d"(epsw) \
: "a"(_a), "d"(1 << shift), "m"(*_a) \
: "memory", "cc"); \
\
!(epsw & EPSW_FLAG_Z); \
})

Definition at line 117 of file bitops.h.

#define __test_and_set_bit (   nr,
  addr 
)
Value:
({ \
volatile unsigned char *_a = (unsigned char *)(addr); \
const unsigned shift = (nr) & 7; \
unsigned epsw; \
_a += (nr) >> 3; \
\
asm volatile("bset %3,(%2) # test_set_bit reg\n" \
"mov epsw,%1" \
: "=m"(*_a), "=d"(epsw) \
: "a"(_a), "d"(1 << shift), "m"(*_a) \
: "memory", "cc"); \
\
!(epsw & EPSW_FLAG_Z); \
})

Definition at line 96 of file bitops.h.

#define clear_bit (   nr,
  addr 
)    ___clear_bit((nr), (addr))

Definition at line 57 of file bitops.h.

#define set_bit (   nr,
  addr 
)    __set_bit((nr), (addr))

Definition at line 40 of file bitops.h.

#define smp_mb__after_clear_bit ( )    barrier()

Definition at line 23 of file bitops.h.

#define smp_mb__before_clear_bit ( )    barrier()

Definition at line 22 of file bitops.h.

#define test_and_clear_bit (   nr,
  addr 
)    __test_and_clear_bit((nr), (addr))

Definition at line 133 of file bitops.h.

#define test_and_set_bit (   nr,
  addr 
)    __test_and_set_bit((nr), (addr))

Definition at line 112 of file bitops.h.

Function Documentation

void change_bit ( unsigned long  nr,
volatile void addr 
)

Definition at line 17 of file bitops.c.

int test_and_change_bit ( unsigned long  nr,
volatile void addr 
)

Definition at line 36 of file bitops.c.