summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-21 05:32:31 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-21 05:32:31 +0000
commite97c21411eebba552a83f02bc99ed6c7dfbfdf57 (patch)
tree8bdb4634b8805cc2c72aba5086698a818e99bf79
parentdce323aeb783d82ec081bf063a944a5654de0be9 (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> Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9579 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9690 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-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 1eccfbf..27ab02b 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1267,6 +1267,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