Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs
seqlock.h File Reference
#include <linux/spinlock.h>
#include <linux/preempt.h>
#include <asm/processor.h>

Go to the source code of this file.

Data Structures

struct  seqlock_t
 
struct  seqcount
 

Macros

#define __SEQLOCK_UNLOCKED(lockname)   { 0, __SPIN_LOCK_UNLOCKED(lockname) }
 
#define seqlock_init(x)
 
#define DEFINE_SEQLOCK(x)   seqlock_t x = __SEQLOCK_UNLOCKED(x)
 
#define SEQCNT_ZERO   { 0 }
 
#define seqcount_init(x)   do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0)
 
#define write_seqlock_irqsave(lock, flags)   do { local_irq_save(flags); write_seqlock(lock); } while (0)
 
#define write_seqlock_irq(lock)   do { local_irq_disable(); write_seqlock(lock); } while (0)
 
#define write_seqlock_bh(lock)   do { local_bh_disable(); write_seqlock(lock); } while (0)
 
#define write_sequnlock_irqrestore(lock, flags)   do { write_sequnlock(lock); local_irq_restore(flags); } while(0)
 
#define write_sequnlock_irq(lock)   do { write_sequnlock(lock); local_irq_enable(); } while(0)
 
#define write_sequnlock_bh(lock)   do { write_sequnlock(lock); local_bh_enable(); } while(0)
 
#define read_seqbegin_irqsave(lock, flags)   ({ local_irq_save(flags); read_seqbegin(lock); })
 
#define read_seqretry_irqrestore(lock, iv, flags)
 

Typedefs

typedef struct seqcount seqcount_t
 

Macro Definition Documentation

#define __SEQLOCK_UNLOCKED (   lockname)    { 0, __SPIN_LOCK_UNLOCKED(lockname) }

Definition at line 42 of file seqlock.h.

#define DEFINE_SEQLOCK (   x)    seqlock_t x = __SEQLOCK_UNLOCKED(x)

Definition at line 51 of file seqlock.h.

#define read_seqbegin_irqsave (   lock,
  flags 
)    ({ local_irq_save(flags); read_seqbegin(lock); })

Definition at line 272 of file seqlock.h.

#define read_seqretry_irqrestore (   lock,
  iv,
  flags 
)
Value:
({ \
int ret = read_seqretry(lock, iv); \
local_irq_restore(flags); \
ret; \
})

Definition at line 275 of file seqlock.h.

#define SEQCNT_ZERO   { 0 }

Definition at line 123 of file seqlock.h.

#define seqcount_init (   x)    do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0)

Definition at line 124 of file seqlock.h.

#define seqlock_init (   x)
Value:
do { \
(x)->sequence = 0; \
spin_lock_init(&(x)->lock); \
} while (0)

Definition at line 45 of file seqlock.h.

#define write_seqlock_bh (   lock)    do { local_bh_disable(); write_seqlock(lock); } while (0)

Definition at line 262 of file seqlock.h.

#define write_seqlock_irq (   lock)    do { local_irq_disable(); write_seqlock(lock); } while (0)

Definition at line 260 of file seqlock.h.

#define write_seqlock_irqsave (   lock,
  flags 
)    do { local_irq_save(flags); write_seqlock(lock); } while (0)

Definition at line 258 of file seqlock.h.

#define write_sequnlock_bh (   lock)    do { write_sequnlock(lock); local_bh_enable(); } while(0)

Definition at line 269 of file seqlock.h.

#define write_sequnlock_irq (   lock)    do { write_sequnlock(lock); local_irq_enable(); } while(0)

Definition at line 267 of file seqlock.h.

#define write_sequnlock_irqrestore (   lock,
  flags 
)    do { write_sequnlock(lock); local_irq_restore(flags); } while(0)

Definition at line 265 of file seqlock.h.

Typedef Documentation