staging: csr: oska: remove timer.c and timer.h
[deliverable/linux.git] / drivers / staging / csr / oska / mutex.h
CommitLineData
15a4bc17
GKH
1/*
2 * OSKA Linux implementation -- mutexes
3 *
4 * Copyright (C) 2007 Cambridge Silicon Radio Ltd.
5 *
6 * Refer to LICENSE.txt included with this source code for details on
7 * the license terms.
8 */
9#ifndef __OSKA_LINUX_MUTEX_H
10#define __OSKA_LINUX_MUTEX_H
11
12#include <linux/kernel.h>
13#include <linux/mutex.h>
7a72e416 14#include <linux/semaphore.h>
15a4bc17 15
15a4bc17
GKH
16
17/* Real mutexes were only added to 2.6.16 so use semaphores
18 instead. */
19typedef struct semaphore os_mutex_t;
20
21static inline void os_mutex_init(os_mutex_t *mutex)
22{
23 //init_MUTEX(mutex);
24 sema_init(mutex, 1);
25}
26
27static inline void os_mutex_destroy(os_mutex_t *mutex)
28{
29 /* no op */
30}
31
32static inline void os_mutex_lock(os_mutex_t *mutex)
33{
34 down(mutex);
35}
36
37static inline void os_mutex_unlock(os_mutex_t *mutex)
38{
39 up(mutex);
40}
41
42#endif /* __OSKA_LINUX_MUTEX_H */
This page took 0.068941 seconds and 5 git commands to generate.