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 ******************************************************************************/
30 #include "sgxinfokm.h"
32 enum PVRSRV_ERROR MMU_Initialise(struct PVRSRV_DEVICE_NODE *psDeviceNode,
33 struct MMU_CONTEXT **ppsMMUContext,
34 struct IMG_DEV_PHYADDR *psPDDevPAddr);
36 void MMU_Finalise(struct MMU_CONTEXT *psMMUContext);
38 void MMU_InsertHeap(struct MMU_CONTEXT *psMMUContext,
39 struct MMU_HEAP *psMMUHeap);
41 struct MMU_HEAP *MMU_Create(struct MMU_CONTEXT *psMMUContext,
42 struct DEV_ARENA_DESCRIPTOR *psDevArena,
43 struct RA_ARENA **ppsVMArena);
45 void MMU_Delete(struct MMU_HEAP *pMMU);
47 IMG_BOOL MMU_Alloc(struct MMU_HEAP *pMMU, size_t uSize, u32 uFlags,
48 u32 uDevVAddrAlignment, struct IMG_DEV_VIRTADDR *pDevVAddr);
50 void MMU_Free(struct MMU_HEAP *pMMU, struct IMG_DEV_VIRTADDR DevVAddr,
53 void MMU_Enable(struct MMU_HEAP *pMMU);
55 void MMU_Disable(struct MMU_HEAP *pMMU);
57 void MMU_MapPages(struct MMU_HEAP *pMMU, struct IMG_DEV_VIRTADDR devVAddr,
58 struct IMG_SYS_PHYADDR SysPAddr, size_t uSize, u32 ui32MemFlags,
61 void MMU_MapShadow(struct MMU_HEAP *pMMU,
62 struct IMG_DEV_VIRTADDR MapBaseDevVAddr, size_t uSize,
63 void *CpuVAddr, void *hOSMemHandle,
64 struct IMG_DEV_VIRTADDR *pDevVAddr, u32 ui32MemFlags,
67 void MMU_UnmapPages(struct MMU_HEAP *pMMU, struct IMG_DEV_VIRTADDR dev_vaddr,
68 u32 ui32PageCount, void *hUniqueTag);
70 void MMU_MapScatter(struct MMU_HEAP *pMMU, struct IMG_DEV_VIRTADDR DevVAddr,
71 struct IMG_SYS_PHYADDR *psSysAddr, size_t uSize,
72 u32 ui32MemFlags, void *hUniqueTag);
74 struct IMG_DEV_PHYADDR MMU_GetPhysPageAddr(struct MMU_HEAP *pMMUHeap,
75 struct IMG_DEV_VIRTADDR sDevVPageAddr);
77 struct IMG_DEV_PHYADDR MMU_GetPDDevPAddr(struct MMU_CONTEXT *pMMUContext);
79 void MMU_InvalidateDirectoryCache(struct PVRSRV_SGXDEV_INFO *psDevInfo);
81 enum PVRSRV_ERROR MMU_BIFResetPDAlloc(struct PVRSRV_SGXDEV_INFO *psDevInfo);
83 void MMU_BIFResetPDFree(struct PVRSRV_SGXDEV_INFO *psDevInfo);
85 u32 mmu_get_page_dir(struct MMU_CONTEXT *pMMUContext);
87 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_PVR_DEBUG)
88 int mmu_hwrec_mem_dump(struct PVRSRV_SGXDEV_INFO *psDevInfo);