blob: d79845d034b530372ff0049655179525a45dffc0 [file] [log] [blame]
Ingo Molnarfb1c8f92005-09-10 00:25:56 -07001#ifndef __LINUX_SPINLOCK_API_SMP_H
2#define __LINUX_SPINLOCK_API_SMP_H
3
4#ifndef __LINUX_SPINLOCK_H
5# error "please don't include this file directly"
6#endif
7
8/*
9 * include/linux/spinlock_api_smp.h
10 *
11 * spinlock API declarations on SMP (and debug)
12 * (implemented in kernel/spinlock.c)
13 *
14 * portions Copyright 2005, Red Hat, Inc., Ingo Molnar
15 * Released under the General Public License (GPL).
16 */
17
18int in_lock_functions(unsigned long addr);
19
20#define assert_spin_locked(x) BUG_ON(!spin_is_locked(x))
21
Josh Triplett9f50b932006-09-29 02:00:59 -070022void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock);
Ingo Molnar8a25d5d2006-07-03 00:24:54 -070023void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
Josh Triplett9f50b932006-09-29 02:00:59 -070024 __acquires(lock);
Peter Zijlstrab7d39af2008-08-11 09:30:24 +020025void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *map)
26 __acquires(lock);
Josh Triplett9f50b932006-09-29 02:00:59 -070027void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock);
28void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock);
29void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock);
30void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(lock);
31void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(lock);
32void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(lock);
33void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock);
34void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070035unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
Josh Triplett9f50b932006-09-29 02:00:59 -070036 __acquires(lock);
Arjan van de Vencfd3ef22006-11-25 11:09:37 -080037unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
38 __acquires(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070039unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
Josh Triplett9f50b932006-09-29 02:00:59 -070040 __acquires(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070041unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
Josh Triplett9f50b932006-09-29 02:00:59 -070042 __acquires(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070043int __lockfunc _spin_trylock(spinlock_t *lock);
44int __lockfunc _read_trylock(rwlock_t *lock);
45int __lockfunc _write_trylock(rwlock_t *lock);
46int __lockfunc _spin_trylock_bh(spinlock_t *lock);
Josh Triplett9f50b932006-09-29 02:00:59 -070047void __lockfunc _spin_unlock(spinlock_t *lock) __releases(lock);
48void __lockfunc _read_unlock(rwlock_t *lock) __releases(lock);
49void __lockfunc _write_unlock(rwlock_t *lock) __releases(lock);
50void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(lock);
51void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(lock);
52void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(lock);
53void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(lock);
54void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(lock);
55void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070056void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
Josh Triplett9f50b932006-09-29 02:00:59 -070057 __releases(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070058void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
Josh Triplett9f50b932006-09-29 02:00:59 -070059 __releases(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070060void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
Josh Triplett9f50b932006-09-29 02:00:59 -070061 __releases(lock);
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070062
63#endif /* __LINUX_SPINLOCK_API_SMP_H */