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
This commit is contained in:
Shaun Ruffell
2011-01-21 05:32:31 +00:00
parent dc653f4d60
commit d28f297d51

View File

@@ -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