5 #ifdef V3_CONFIG_DEBUG_LOCKS
7 // Maxmimum number of locks to handle
9 // Maximum number of locks that can be simultaneously
11 #define LOCK_STACK_DEPTH 16
14 // The following macros are used
15 // in the stub functions to call back to the lock
16 // checker - if lock checking is not enabled, these
19 #define LOCKCHECK_INIT() palacios_lockcheck_init()
20 #define LOCKCHECK_ALLOC(lock) palacios_lockcheck_alloc(lock)
21 #define LOCKCHECK_FREE(lock) palacios_lockcheck_free(lock)
22 #define LOCKCHECK_LOCK_PRE(lock)
23 #define LOCKCHECK_LOCK_POST(lock) palacios_lockcheck_lock(lock)
24 #define LOCKCHECK_UNLOCK_PRE(lock) palacios_lockcheck_unlock(lock)
25 #define LOCKCHECK_UNLOCK_POST(lock)
26 #define LOCKCHECK_LOCK_IRQSAVE_PRE(lock, flags)
27 #define LOCKCHECK_LOCK_IRQSAVE_POST(lock, flags) palacios_lockcheck_lock_irqsave(lock,flags)
28 #define LOCKCHECK_UNLOCK_IRQRESTORE_PRE(lock, flags) palacios_lockcheck_unlock_irqrestore_pre(lock,flags)
29 #define LOCKCHECK_UNLOCK_IRQRESTORE_POST(lock, flags) palacios_lockcheck_unlock_irqrestore_post(lock,flags)
30 #define LOCKCHECK_DEINIT() palacios_lockcheck_deinit()
32 void palacios_lockcheck_init(void);
33 void palacios_lockcheck_alloc(void *lock);
34 void palacios_lockcheck_free(void *lock);
35 void palacios_lockcheck_lock(void *lock);
36 void palacios_lockcheck_unlock(void *lock);
37 void palacios_lockcheck_lock_irqsave(void *lock,unsigned long flags);
38 void palacios_lockcheck_unlock_irqrestore_pre(void *lock,unsigned long flags);
39 void palacios_lockcheck_unlock_irqrestore_post(void *lock,unsigned long flags);
40 void palacios_lockcheck_deinit(void);
45 // The following is what happens when lock checking is not on
47 #define LOCKCHECK_INIT()
48 #define LOCKCHECK_ALLOC(lock)
49 #define LOCKCHECK_FREE(lock)
50 #define LOCKCHECK_LOCK_PRE(lock)
51 #define LOCKCHECK_LOCK_POST(lock)
52 #define LOCKCHECK_UNLOCK_PRE(lock)
53 #define LOCKCHECK_UNLOCK_POST(lock)
54 #define LOCKCHECK_LOCK_IRQSAVE_PRE(lock, flags)
55 #define LOCKCHECK_LOCK_IRQSAVE_POST(lock, flags)
56 #define LOCKCHECK_UNLOCK_IRQRESTORE_PRE(lock, flags)
57 #define LOCKCHECK_UNLOCK_IRQRESTORE_POST(lock, flags)
58 #define LOCKCHECK_DEINIT()