summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-03 18:26:00 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-03 18:26:00 +0000
commit86c499abc449e02735cd9539254ac363773d2f7d (patch)
treec4d7a84a7b84681477fb00518dab7f3de737e6e6 /include
parent0c409bba72005ca55ee5ed602e0f81d856bfe352 (diff)
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 <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9579 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include')
-rw-r--r--include/dahdi/kernel.h6
1 files changed, 6 insertions, 0 deletions
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