Atomic Bit Operations
[Bit Operations]

Collaboration diagram for Atomic Bit Operations:

Functions

static void atomic_set_bit (unsigned int nr, bit_word_t *bitmap)
 Atomically set bit nr in bitmap.
static void atomic_clear_bit (unsigned int nr, bit_word_t *bitmap)
 Atomically clear bit nr in bitmap.
static void atomic_toggle_bit (unsigned int nr, bit_word_t *bitmap)
 Atomically toggle bit nr in bitmap.
static bool atomic_test_and_set_bit (unsigned int nr, bit_word_t *bitmap)
 Atomically set bit nr in bitmap and return its previous state.
static bool atomic_test_and_clear_bit (unsigned int nr, bit_word_t *bitmap)
 Atomically clear bit nr in bitmap and return its previous state.

Detailed Description

Atomic bit operations have the same semantics as the regular bit operations, except that the bitmaps are accessed atomically so it is safe to use atomic bit operations on a bitmap which may also be altered by an interrupt handler, even without disabling interrupt.

The architecture-specific implementation of atomic bit operations may disable interrupts internally in order to ensure atomicity, but this is purely an implementation detail.


Function Documentation

static void atomic_clear_bit ( unsigned int  nr,
bit_word_t bitmap 
) [inline, static]

Atomically clear bit nr in bitmap.

Definition at line 79 of file bitops.h.

References clear_bit, cpu_irq_restore(), and cpu_irq_save().

static void atomic_set_bit ( unsigned int  nr,
bit_word_t bitmap 
) [inline, static]

Atomically set bit nr in bitmap.

Definition at line 67 of file bitops.h.

References cpu_irq_restore(), cpu_irq_save(), and set_bit.

Referenced by softirq_raise().

static bool atomic_test_and_clear_bit ( unsigned int  nr,
bit_word_t bitmap 
) [inline, static]

Atomically clear bit nr in bitmap and return its previous state.

Definition at line 121 of file bitops.h.

References clear_bit, cpu_irq_restore(), cpu_irq_save(), and test_bit.

static bool atomic_test_and_set_bit ( unsigned int  nr,
bit_word_t bitmap 
) [inline, static]

Atomically set bit nr in bitmap and return its previous state.

Definition at line 104 of file bitops.h.

References cpu_irq_restore(), cpu_irq_save(), set_bit, and test_bit.

static void atomic_toggle_bit ( unsigned int  nr,
bit_word_t bitmap 
) [inline, static]

Atomically toggle bit nr in bitmap.

Definition at line 91 of file bitops.h.

References cpu_irq_restore(), cpu_irq_save(), and toggle_bit.

Generated on Thu Apr 29 15:18:23 2010 for display-training by  doxygen 1.6.3