Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cleanup of linkage issues for non-Linux hosts
[palacios.git] / linux_module / lockcheck.h
1 #ifndef _lockcheck
2 #define _lockcheck
3
4
5 #ifdef V3_CONFIG_DEBUG_LOCKS
6
7 // Maxmimum number of locks to handle
8 #define NUM_LOCKS        1024
9 // Maximum number of locks that can be simultaneously
10 // held on each CPU
11 #define LOCK_STACK_DEPTH 16
12
13 //
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 
17 // turn into nothing
18 //
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()
31
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);
41
42 #else
43
44 //
45 // The following is what happens when lock checking is not on
46 //
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()
59
60 #endif
61
62
63 #endif