blob: fc549713bba3f4749807cee8964d178cb286080e [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Ingo Molnare7eebaf2006-06-27 02:54:55 -07002/*
3 * RT-Mutexes: blocking mutual exclusion locks with PI support
4 *
5 * started by Ingo Molnar and Thomas Gleixner:
6 *
7 * Copyright (C) 2004-2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
8 * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com>
9 *
10 * This file contains macros used solely by rtmutex.c. Debug version.
11 */
12
Ingo Molnare7eebaf2006-06-27 02:54:55 -070013extern void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter);
14extern void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter);
Peter Zijlstraf5694782016-09-19 12:15:37 +020015extern void debug_rt_mutex_init(struct rt_mutex *lock, const char *name, struct lock_class_key *key);
Ingo Molnar9a11b49a2006-07-03 00:24:33 -070016extern void debug_rt_mutex_lock(struct rt_mutex *lock);
Ingo Molnare7eebaf2006-06-27 02:54:55 -070017extern void debug_rt_mutex_unlock(struct rt_mutex *lock);
18extern void debug_rt_mutex_proxy_lock(struct rt_mutex *lock,
Ingo Molnar9a11b49a2006-07-03 00:24:33 -070019 struct task_struct *powner);
Ingo Molnare7eebaf2006-06-27 02:54:55 -070020extern void debug_rt_mutex_proxy_unlock(struct rt_mutex *lock);
Thomas Gleixner8930ed82014-05-22 03:25:47 +000021extern void debug_rt_mutex_deadlock(enum rtmutex_chainwalk chwalk,
22 struct rt_mutex_waiter *waiter,
Ingo Molnare7eebaf2006-06-27 02:54:55 -070023 struct rt_mutex *lock);
24extern void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter);
25# define debug_rt_mutex_reset_waiter(w) \
26 do { (w)->deadlock_lock = NULL; } while (0)
27
Thomas Gleixner8930ed82014-05-22 03:25:47 +000028static inline bool debug_rt_mutex_detect_deadlock(struct rt_mutex_waiter *waiter,
29 enum rtmutex_chainwalk walk)
Ingo Molnare7eebaf2006-06-27 02:54:55 -070030{
31 return (waiter != NULL);
32}
Thomas Gleixner3d5c9342014-06-05 12:34:23 +020033
34static inline void rt_mutex_print_deadlock(struct rt_mutex_waiter *w)
35{
36 debug_rt_mutex_print_deadlock(w);
37}