diff options
Diffstat (limited to 'drivers/gpu/pvr/mmap.h')
-rw-r--r-- | drivers/gpu/pvr/mmap.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/mmap.h b/drivers/gpu/pvr/mmap.h new file mode 100644 index 00000000000..486154a241f --- /dev/null +++ b/drivers/gpu/pvr/mmap.h | |||
@@ -0,0 +1,113 @@ | |||
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 | #if !defined(__MMAP_H__) | ||
28 | #define __MMAP_H__ | ||
29 | |||
30 | #include <linux/mm.h> | ||
31 | #include <linux/list.h> | ||
32 | |||
33 | #if defined(VM_MIXEDMAP) | ||
34 | #define PVR_MAKE_ALL_PFNS_SPECIAL | ||
35 | #endif | ||
36 | |||
37 | #include "perproc.h" | ||
38 | #include "mm.h" | ||
39 | |||
40 | typedef struct KV_OFFSET_STRUCT_TAG | ||
41 | { | ||
42 | |||
43 | IMG_UINT32 ui32Mapped; | ||
44 | |||
45 | |||
46 | IMG_UINT32 ui32MMapOffset; | ||
47 | |||
48 | IMG_UINT32 ui32RealByteSize; | ||
49 | |||
50 | |||
51 | LinuxMemArea *psLinuxMemArea; | ||
52 | |||
53 | #if !defined(PVR_MAKE_ALL_PFNS_SPECIAL) | ||
54 | |||
55 | IMG_UINT32 ui32TID; | ||
56 | #endif | ||
57 | |||
58 | |||
59 | IMG_UINT32 ui32PID; | ||
60 | |||
61 | |||
62 | IMG_BOOL bOnMMapList; | ||
63 | |||
64 | |||
65 | IMG_UINT32 ui32RefCount; | ||
66 | |||
67 | |||
68 | IMG_UINT32 ui32UserVAddr; | ||
69 | |||
70 | |||
71 | #if defined(DEBUG_LINUX_MMAP_AREAS) | ||
72 | const IMG_CHAR *pszName; | ||
73 | #endif | ||
74 | |||
75 | |||
76 | struct list_head sMMapItem; | ||
77 | |||
78 | |||
79 | struct list_head sAreaItem; | ||
80 | }KV_OFFSET_STRUCT, *PKV_OFFSET_STRUCT; | ||
81 | |||
82 | |||
83 | |||
84 | IMG_VOID PVRMMapInit(IMG_VOID); | ||
85 | |||
86 | |||
87 | IMG_VOID PVRMMapCleanup(IMG_VOID); | ||
88 | |||
89 | |||
90 | PVRSRV_ERROR PVRMMapRegisterArea(LinuxMemArea *psLinuxMemArea); | ||
91 | |||
92 | |||
93 | PVRSRV_ERROR PVRMMapRemoveRegisteredArea(LinuxMemArea *psLinuxMemArea); | ||
94 | |||
95 | |||
96 | PVRSRV_ERROR PVRMMapOSMemHandleToMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc, | ||
97 | IMG_HANDLE hMHandle, | ||
98 | IMG_UINT32 *pui32MMapOffset, | ||
99 | IMG_UINT32 *pui32ByteOffset, | ||
100 | IMG_UINT32 *pui32RealByteSize, IMG_UINT32 *pui32UserVAddr); | ||
101 | |||
102 | PVRSRV_ERROR | ||
103 | PVRMMapReleaseMMapData(PVRSRV_PER_PROCESS_DATA *psPerProc, | ||
104 | IMG_HANDLE hMHandle, | ||
105 | IMG_BOOL *pbMUnmap, | ||
106 | IMG_UINT32 *pui32RealByteSize, | ||
107 | IMG_UINT32 *pui32UserVAddr); | ||
108 | |||
109 | int PVRMMap(struct file* pFile, struct vm_area_struct* ps_vma); | ||
110 | |||
111 | |||
112 | #endif | ||
113 | |||