diff options
Diffstat (limited to 'drivers/gpu/pvr/mutex.h')
-rw-r--r-- | drivers/gpu/pvr/mutex.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/mutex.h b/drivers/gpu/pvr/mutex.h new file mode 100644 index 00000000000..b24a5990f8f --- /dev/null +++ b/drivers/gpu/pvr/mutex.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /********************************************************************** | ||
2 | * | ||
3 | * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful but, except | ||
10 | * as otherwise stated in writing, without any warranty; without even the | ||
11 | * implied warranty of merchantability or fitness for a particular purpose. | ||
12 | * See the GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in | ||
19 | * the file called "COPYING". | ||
20 | * | ||
21 | * Contact Information: | ||
22 | * Imagination Technologies Ltd. <gpl-support@imgtec.com> | ||
23 | * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK | ||
24 | * | ||
25 | ******************************************************************************/ | ||
26 | |||
27 | #ifndef __INCLUDED_LINUX_MUTEX_H_ | ||
28 | #define __INCLUDED_LINUX_MUTEX_H_ | ||
29 | |||
30 | #include <linux/version.h> | ||
31 | |||
32 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) | ||
33 | #include <linux/mutex.h> | ||
34 | #else | ||
35 | #include <asm/semaphore.h> | ||
36 | #endif | ||
37 | |||
38 | |||
39 | |||
40 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) | ||
41 | |||
42 | typedef struct mutex PVRSRV_LINUX_MUTEX; | ||
43 | |||
44 | #else | ||
45 | |||
46 | |||
47 | typedef struct { | ||
48 | struct semaphore sSemaphore; | ||
49 | |||
50 | atomic_t Count; | ||
51 | }PVRSRV_LINUX_MUTEX; | ||
52 | |||
53 | #endif | ||
54 | |||
55 | |||
56 | extern IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex); | ||
57 | |||
58 | extern IMG_VOID LinuxLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex); | ||
59 | |||
60 | extern PVRSRV_ERROR LinuxLockMutexInterruptible(PVRSRV_LINUX_MUTEX *psPVRSRVMutex); | ||
61 | |||
62 | extern IMG_INT32 LinuxTryLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex); | ||
63 | |||
64 | extern IMG_VOID LinuxUnLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex); | ||
65 | |||
66 | extern IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex); | ||
67 | |||
68 | |||
69 | #endif | ||
70 | |||