xref: /optee_os/core/kernel/mutex_lockdep.h (revision e0e51e3f84f4a2d1732830fa47d31f0c5ad59c1e)
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