X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Flockcheck.h;fp=linux_module%2Flockcheck.h;h=7151bd00127a26856e2068ad595473e5cc5ab918;hb=5c2a2684778fa080c41a0f04518721ebe476efb1;hp=0000000000000000000000000000000000000000;hpb=cccc6b1a738266ed3d3bd2011b573e7033c012a8;p=palacios.git diff --git a/linux_module/lockcheck.h b/linux_module/lockcheck.h new file mode 100644 index 0000000..7151bd0 --- /dev/null +++ b/linux_module/lockcheck.h @@ -0,0 +1,36 @@ +#ifndef _lockcheck +#define _lockcheck + +#define CHECK_LOCKS 0 +#define NUM_LOCKS 1024 + +#if CHECK_LOCKS +#define LOCKCHECK_INIT() palacios_lockcheck_init() +#define LOCKCHECK_ALLOC(lock) palacios_lockcheck_alloc(lock) +#define LOCKCHECK_FREE(lock) palacios_lockcheck_free(lock) +#define LOCKCHECK_LOCK(lock) palacios_lockcheck_lock(lock) +#define LOCKCHECK_UNLOCK(lock) palacios_lockcheck_unlock(lock) +#define LOCKCHECK_LOCK_IRQSAVE(lock, flags) palacios_lockcheck_lock_irqsave(lock,flags) +#define LOCKCHECK_UNLOCK_IRQRESTORE(lock, flags) palacios_lockcheck_unlock_irqrestore(lock,flags) +#define LOCKCHECK_DEINIT() palacios_lockcheck_deinit() +#else +#define LOCKCHECK_INIT() +#define LOCKCHECK_ALLOC(lock) +#define LOCKCHECK_FREE(lock) +#define LOCKCHECK_LOCK(lock) +#define LOCKCHECK_UNLOCK(lock) +#define LOCKCHECK_LOCK_IRQSAVE(lock, flags) +#define LOCKCHECK_UNLOCK_IRQRESTORE(lock, flags) +#define LOCKCHECK_DEINIT() +#endif + +void palacios_lockcheck_init(void); +void palacios_lockcheck_alloc(void *lock); +void palacios_lockcheck_free(void *lock); +void palacios_lockcheck_lock(void *lock); +void palacios_lockcheck_unlock(void *lock); +void palacios_lockcheck_lock_irqsave(void *lock,unsigned long flags); +void palacios_lockcheck_unlock_irqrestore(void *lock,unsigned long flags); +void palacios_lockcheck_deinit(void); + +#endif