From 593787e3b3ccccfc5e37bc7b7c4744266dc373b1 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 3 Jan 2011 18:26:00 +0000 Subject: [PATCH] dahdi: If mutexes are not available use semaphores instead. Mutexes were added in 2.6.16. This will allow future changes to use the mutex API without breaking on pre 2.6.16 kernels. Signed-off-by: Shaun Ruffell Acked-by: Kinsey Moore git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9579 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- include/dahdi/kernel.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index ce503d9..584eb8c 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -1317,6 +1317,12 @@ wait_for_completion_interruptible_timeout(struct completion *x, struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) #endif +#ifndef DEFINE_MUTEX +#define DEFINE_MUTEX DEFINE_SEMAPHORE +#define mutex_lock(_x) down(_x) +#define mutex_unlock(_x) up(_x) +#endif + #ifndef DMA_BIT_MASK #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) #endif