Merge git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[powerpc.git] / include / linux / rtmutex.h
index 12309c9..382bb79 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/plist.h>
 #include <linux/spinlock_types.h>
 
-/*
+/**
  * The rt_mutex structure
  *
  * @wait_lock: spinlock to protect the structure
@@ -29,8 +29,6 @@ struct rt_mutex {
        struct task_struct      *owner;
 #ifdef CONFIG_DEBUG_RT_MUTEXES
        int                     save_state;
-       struct list_head        held_list_entry;
-       unsigned long           acquire_ip;
        const char              *name, *file;
        int                     line;
        void                    *magic;
@@ -40,6 +38,19 @@ struct rt_mutex {
 struct rt_mutex_waiter;
 struct hrtimer_sleeper;
 
+#ifdef CONFIG_DEBUG_RT_MUTEXES
+ extern int rt_mutex_debug_check_no_locks_freed(const void *from,
+                                               unsigned long len);
+ extern void rt_mutex_debug_check_no_locks_held(struct task_struct *task);
+#else
+ static inline int rt_mutex_debug_check_no_locks_freed(const void *from,
+                                                      unsigned long len)
+ {
+       return 0;
+ }
+# define rt_mutex_debug_check_no_locks_held(task)      do { } while (0)
+#endif
+
 #ifdef CONFIG_DEBUG_RT_MUTEXES
 # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \
        , .name = #mutexname, .file = __FILE__, .line = __LINE__
@@ -48,11 +59,11 @@ struct hrtimer_sleeper;
 #else
 # define __DEBUG_RT_MUTEX_INITIALIZER(mutexname)
 # define rt_mutex_init(mutex)                  __rt_mutex_init(mutex, NULL)
-# define rt_mutex_debug_task_free(t)           do { } while (0)
+# define rt_mutex_debug_task_free(t)                   do { } while (0)
 #endif
 
 #define __RT_MUTEX_INITIALIZER(mutexname) \
-       { .wait_lock = SPIN_LOCK_UNLOCKED \
+       { .wait_lock = __SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
        , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \
        , .owner = NULL \
        __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
@@ -60,7 +71,7 @@ struct hrtimer_sleeper;
 #define DEFINE_RT_MUTEX(mutexname) \
        struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)
 
-/***
+/**
  * rt_mutex_is_locked - is the mutex locked
  * @lock: the mutex to be queried
  *
@@ -85,14 +96,6 @@ extern int rt_mutex_trylock(struct rt_mutex *lock);
 
 extern void rt_mutex_unlock(struct rt_mutex *lock);
 
-#ifdef CONFIG_DEBUG_RT_MUTEXES
-# define INIT_RT_MUTEX_DEBUG(tsk)                                      \
-       .held_list_head = LIST_HEAD_INIT(tsk.held_list_head),           \
-       .held_list_lock = SPIN_LOCK_UNLOCKED
-#else
-# define INIT_RT_MUTEX_DEBUG(tsk)
-#endif
-
 #ifdef CONFIG_RT_MUTEXES
 # define INIT_RT_MUTEXES(tsk)                                          \
        .pi_waiters     = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \