source: GPL/trunk/include/linux/mutex.h

Last change on this file was 679, checked in by David Azarewicz, 4 years ago

Merge changes from Paul's uniaud32next branch.

File size: 850 bytes
Line 
1#ifndef __LINUX_MUTEX_H
2#define __LINUX_MUTEX_H
3
4#include <asm/semaphore.h>
5#include <linux/list.h>
6#include <linux/types.h>
7
8struct mutex {
9 atomic_long_t owner;
10 spinlock_t wait_lock;
11#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
12 struct optimistic_spin_queue osq; /* Spinner MCS lock */
13#endif
14 struct list_head wait_list;
15#ifdef CONFIG_DEBUG_MUTEXES
16 void *magic;
17#endif
18#ifdef CONFIG_DEBUG_LOCK_ALLOC
19 struct lockdep_map dep_map;
20#endif
21};
22
23#define mutex semaphore
24#define DEFINE_MUTEX(x) DECLARE_MUTEX(x)
25#define mutex_init(x) init_MUTEX(x)
26#define mutex_destroy(x)
27#define mutex_lock(x) down(x)
28#define mutex_lock_interruptible(x) down_interruptible(x)
29#define mutex_unlock(x) up(x)
30#define mutex_lock_nested(lock, subclass) mutex_lock(lock)
31static inline int mutex_trylock(struct mutex *lock) {return -1; }
32#endif
Note: See TracBrowser for help on using the repository browser.