xref: /optee_os/core/kernel/mutex_lockdep.h (revision 9f34db38245c9b3a4e6e7e63eb78a75e23ab2da3)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2018, Linaro Limited
4  */
5 #ifndef MUTEX_LOCKDEP_H
6 #define MUTEX_LOCKDEP_H
7 
8 #include <compiler.h>
9 #include <kernel/mutex.h>
10 
11 #ifdef CFG_LOCKDEP
12 
13 void mutex_lock_check(struct mutex *m);
14 
15 void mutex_trylock_check(struct mutex *m);
16 
17 void mutex_unlock_check(struct mutex *m);
18 
19 void mutex_destroy_check(struct mutex *m);
20 
21 #else
22 
23 static inline void mutex_lock_check(struct mutex *m __unused)
24 {}
25 
26 static inline void mutex_trylock_check(struct mutex *m __unused)
27 {}
28 
29 static inline void mutex_unlock_check(struct mutex *m __unused)
30 {}
31 
32 static inline void mutex_destroy_check(struct mutex *m __unused)
33 {}
34 
35 #endif /* !CFG_LOCKDEP */
36 
37 #endif /* MUTEX_LOCKDEP_H */
38