blob: 67578ca48f94e1dad6f7cf3760c28d20a86605e2 [file] [log] [blame]
Ingo Molnar6053ee32006-01-09 15:59:19 -08001/*
2 * Mutexes: blocking mutual exclusion locks
3 *
4 * started by Ingo Molnar:
5 *
6 * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
7 *
8 * This file contains mutex debugging related internal prototypes, for the
9 * !CONFIG_DEBUG_MUTEXES case. Most of them are NOPs:
10 */
11
Ingo Molnar1fb00c62006-06-26 00:24:31 -070012#define spin_lock_mutex(lock, flags) \
13 do { spin_lock(lock); (void)(flags); } while (0)
14#define spin_unlock_mutex(lock, flags) \
15 do { spin_unlock(lock); (void)(flags); } while (0)
Ingo Molnar6053ee32006-01-09 15:59:19 -080016#define mutex_remove_waiter(lock, waiter, ti) \
17 __list_del((waiter)->list.prev, (waiter)->list.next)
18
Peter Zijlstra0d66bf62009-01-12 14:01:47 +010019#ifdef CONFIG_SMP
20static inline void mutex_set_owner(struct mutex *lock)
21{
22 lock->owner = current_thread_info();
23}
24
25static inline void mutex_clear_owner(struct mutex *lock)
26{
27 lock->owner = NULL;
28}
29#else
30static inline void mutex_set_owner(struct mutex *lock)
31{
32}
33
34static inline void mutex_clear_owner(struct mutex *lock)
35{
36}
37#endif
38
Ingo Molnar6053ee32006-01-09 15:59:19 -080039#define debug_mutex_wake_waiter(lock, waiter) do { } while (0)
40#define debug_mutex_free_waiter(waiter) do { } while (0)
Ingo Molnar9a11b49a2006-07-03 00:24:33 -070041#define debug_mutex_add_waiter(lock, waiter, ti) do { } while (0)
Ingo Molnar6053ee32006-01-09 15:59:19 -080042#define debug_mutex_unlock(lock) do { } while (0)
Ingo Molnaref5d4702006-07-03 00:24:55 -070043#define debug_mutex_init(lock, name, key) do { } while (0)
Ingo Molnar6053ee32006-01-09 15:59:19 -080044
Ingo Molnar9a11b49a2006-07-03 00:24:33 -070045static inline void
46debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
47{
48}