Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
spinlock.h File Reference
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <linux/atomic.h>
#include <asm/intrinsics.h>

Go to the source code of this file.

Macros

#define arch_spin_lock_init(x)   ((x)->lock = 0)
 
#define TICKET_SHIFT   17
 
#define TICKET_BITS   15
 
#define TICKET_MASK   ((1 << TICKET_BITS) - 1)
 
#define arch_spin_is_contended   arch_spin_is_contended
 
#define arch_read_can_lock(rw)   (*(volatile int *)(rw) >= 0)
 
#define arch_write_can_lock(rw)   (*(volatile int *)(rw) == 0)
 
#define arch_read_lock_flags(rw, flags)   arch_read_lock(rw)
 
#define arch_read_lock(rw)
 
#define arch_read_unlock(rw)
 
#define arch_write_lock_flags(l, flags)   arch_write_lock(l)
 
#define arch_write_lock(l)
 
#define arch_write_trylock(rw)
 
#define arch_spin_relax(lock)   cpu_relax()
 
#define arch_read_relax(lock)   cpu_relax()
 
#define arch_write_relax(lock)   cpu_relax()
 

Macro Definition Documentation

#define arch_read_can_lock (   rw)    (*(volatile int *)(rw) >= 0)

Definition at line 142 of file spinlock.h.

#define arch_read_lock (   rw)
Value:
do { \
arch_rwlock_t *__read_lock_ptr = (rw); \
\
while (unlikely(ia64_fetchadd(1, (int *) __read_lock_ptr, acq) < 0)) { \
ia64_fetchadd(-1, (int *) __read_lock_ptr, rel); \
while (*(volatile int *)__read_lock_ptr < 0) \
cpu_relax(); \
} \
} while (0)

Definition at line 177 of file spinlock.h.

#define arch_read_lock_flags (   rw,
  flags 
)    arch_read_lock(rw)

Definition at line 175 of file spinlock.h.

#define arch_read_relax (   lock)    cpu_relax()

Definition at line 288 of file spinlock.h.

#define arch_read_unlock (   rw)
Value:
do { \
arch_rwlock_t *__read_lock_ptr = (rw); \
ia64_fetchadd(-1, (int *) __read_lock_ptr, rel); \
} while (0)

Definition at line 190 of file spinlock.h.

#define arch_spin_is_contended   arch_spin_is_contended

Definition at line 114 of file spinlock.h.

#define arch_spin_lock_init (   x)    ((x)->lock = 0)

Definition at line 19 of file spinlock.h.

#define arch_spin_relax (   lock)    cpu_relax()

Definition at line 287 of file spinlock.h.

#define arch_write_can_lock (   rw)    (*(volatile int *)(rw) == 0)

Definition at line 143 of file spinlock.h.

#define arch_write_lock (   l)
Value:
({ \
__u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1); \
__u32 *ia64_write_lock_ptr = (__u32 *) (l); \
do { \
while (*ia64_write_lock_ptr) \
ia64_barrier(); \
ia64_val = ia64_cmpxchg4_acq(ia64_write_lock_ptr, ia64_set_val, 0); \
} while (ia64_val); \
})

Definition at line 248 of file spinlock.h.

#define arch_write_lock_flags (   l,
  flags 
)    arch_write_lock(l)

Definition at line 246 of file spinlock.h.

#define arch_write_relax (   lock)    cpu_relax()

Definition at line 289 of file spinlock.h.

#define arch_write_trylock (   rw)
Value:
({ \
__u64 ia64_val; \
__u64 ia64_set_val = ia64_dep_mi(-1, 0, 31,1); \
ia64_val = ia64_cmpxchg4_acq((__u32 *)(rw), ia64_set_val, 0); \
(ia64_val == 0); \
})

Definition at line 259 of file spinlock.h.

#define TICKET_BITS   15

Definition at line 37 of file spinlock.h.

#define TICKET_MASK   ((1 << TICKET_BITS) - 1)

Definition at line 38 of file spinlock.h.

#define TICKET_SHIFT   17

Definition at line 36 of file spinlock.h.