linux/include/linux/rwlock_api_smp.h

#ifndef __LINUX_RWLOCK_API_SMP_H
#define __LINUX_RWLOCK_API_SMP_H

#ifndef __LINUX_SPINLOCK_API_SMP_H
# error "please don't include this file directly"
#endif

/*
 * include/linux/rwlock_api_smp.h
 *
 * spinlock API declarations on SMP (and debug)
 * (implemented in kernel/spinlock.c)
 *
 * portions Copyright 2005, Red Hat, Inc., Ingo Molnar
 * Released under the General Public License (GPL).
 */

void __lockfunc _raw_read_lock(rwlock_t *lock)		__acquires();
void __lockfunc _raw_write_lock(rwlock_t *lock)		__acquires();
void __lockfunc _raw_write_lock_nested(rwlock_t *lock, int subclass)	__acquires();
void __lockfunc _raw_read_lock_bh(rwlock_t *lock)	__acquires();
void __lockfunc _raw_write_lock_bh(rwlock_t *lock)	__acquires();
void __lockfunc _raw_read_lock_irq(rwlock_t *lock)	__acquires();
void __lockfunc _raw_write_lock_irq(rwlock_t *lock)	__acquires();
unsigned long __lockfunc _raw_read_lock_irqsave(rwlock_t *lock)
							__acquires();
unsigned long __lockfunc _raw_write_lock_irqsave(rwlock_t *lock)
							__acquires();
int __lockfunc _raw_read_trylock(rwlock_t *lock);
int __lockfunc _raw_write_trylock(rwlock_t *lock);
void __lockfunc _raw_read_unlock(rwlock_t *lock)	__releases();
void __lockfunc _raw_write_unlock(rwlock_t *lock)	__releases();
void __lockfunc _raw_read_unlock_bh(rwlock_t *lock)	__releases();
void __lockfunc _raw_write_unlock_bh(rwlock_t *lock)	__releases();
void __lockfunc _raw_read_unlock_irq(rwlock_t *lock)	__releases();
void __lockfunc _raw_write_unlock_irq(rwlock_t *lock)	__releases();
void __lockfunc
_raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
							__releases();
void __lockfunc
_raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
							__releases();

#ifdef CONFIG_INLINE_READ_LOCK
#define _raw_read_lock
#endif

#ifdef CONFIG_INLINE_WRITE_LOCK
#define _raw_write_lock
#endif

#ifdef CONFIG_INLINE_READ_LOCK_BH
#define _raw_read_lock_bh
#endif

#ifdef CONFIG_INLINE_WRITE_LOCK_BH
#define _raw_write_lock_bh
#endif

#ifdef CONFIG_INLINE_READ_LOCK_IRQ
#define _raw_read_lock_irq
#endif

#ifdef CONFIG_INLINE_WRITE_LOCK_IRQ
#define _raw_write_lock_irq
#endif

#ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE
#define _raw_read_lock_irqsave
#endif

#ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE
#define _raw_write_lock_irqsave
#endif

#ifdef CONFIG_INLINE_READ_TRYLOCK
#define _raw_read_trylock
#endif

#ifdef CONFIG_INLINE_WRITE_TRYLOCK
#define _raw_write_trylock
#endif

#ifdef CONFIG_INLINE_READ_UNLOCK
#define _raw_read_unlock
#endif

#ifdef CONFIG_INLINE_WRITE_UNLOCK
#define _raw_write_unlock
#endif

#ifdef CONFIG_INLINE_READ_UNLOCK_BH
#define _raw_read_unlock_bh
#endif

#ifdef CONFIG_INLINE_WRITE_UNLOCK_BH
#define _raw_write_unlock_bh
#endif

#ifdef CONFIG_INLINE_READ_UNLOCK_IRQ
#define _raw_read_unlock_irq
#endif

#ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ
#define _raw_write_unlock_irq
#endif

#ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE
#define _raw_read_unlock_irqrestore
#endif

#ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE
#define _raw_write_unlock_irqrestore
#endif

static inline int __raw_read_trylock(rwlock_t *lock)
{}

static inline int __raw_write_trylock(rwlock_t *lock)
{}

/*
 * If lockdep is enabled then we use the non-preemption spin-ops
 * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are
 * not re-enabled during lock-acquire (which the preempt-spin-ops do):
 */
#if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC)

static inline void __raw_read_lock(rwlock_t *lock)
{}

static inline unsigned long __raw_read_lock_irqsave(rwlock_t *lock)
{}

static inline void __raw_read_lock_irq(rwlock_t *lock)
{}

static inline void __raw_read_lock_bh(rwlock_t *lock)
{}

static inline unsigned long __raw_write_lock_irqsave(rwlock_t *lock)
{}

static inline void __raw_write_lock_irq(rwlock_t *lock)
{}

static inline void __raw_write_lock_bh(rwlock_t *lock)
{}

static inline void __raw_write_lock(rwlock_t *lock)
{}

static inline void __raw_write_lock_nested(rwlock_t *lock, int subclass)
{}

#endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */

static inline void __raw_write_unlock(rwlock_t *lock)
{}

static inline void __raw_read_unlock(rwlock_t *lock)
{}

static inline void
__raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
{}

static inline void __raw_read_unlock_irq(rwlock_t *lock)
{}

static inline void __raw_read_unlock_bh(rwlock_t *lock)
{}

static inline void __raw_write_unlock_irqrestore(rwlock_t *lock,
					     unsigned long flags)
{}

static inline void __raw_write_unlock_irq(rwlock_t *lock)
{}

static inline void __raw_write_unlock_bh(rwlock_t *lock)
{}

#endif /* __LINUX_RWLOCK_API_SMP_H */