1 /**********************************************************************
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
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.
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.
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.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25 ******************************************************************************/
27 #if !defined(__MMAP_H__)
31 #include <linux/list.h>
36 struct KV_OFFSET_STRUCT {
40 struct LinuxMemArea *psLinuxMemArea;
46 #if defined(DEBUG_LINUX_MMAP_AREAS)
49 struct list_head sMMapItem;
50 struct list_head sAreaItem;
53 void PVRMMapInit(void);
54 void PVRMMapCleanup(void);
56 enum PVRSRV_ERROR PVRMMapRegisterArea(struct LinuxMemArea *psLinuxMemArea);
58 enum PVRSRV_ERROR PVRMMapRemoveRegisteredArea(
59 struct LinuxMemArea *psLinuxMemArea);
61 enum PVRSRV_ERROR PVRMMapOSMemHandleToMMapData(
62 struct PVRSRV_PER_PROCESS_DATA *psPerProc,
63 void *hMHandle, u32 *pui32MMapOffset,
64 u32 *pui32ByteOffset, u32 *pui32RealByteSize,
67 enum PVRSRV_ERROR PVRMMapReleaseMMapData(
68 struct PVRSRV_PER_PROCESS_DATA *psPerProc,
69 void *hMHandle, IMG_BOOL *pbMUnmap,
70 u32 *pui32RealByteSize, u32 *pui32UserVAddr);
72 int PVRMMap(struct file *pFile, struct vm_area_struct *ps_vma);