📄 memory.c
字号:
/*!****************************************************************************
@File memory.c
@Title User side memory allocation and remapping
@Author Imagination Technologies
@date 24/10/2003
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
All rights reserved. No part of this software, either
material or conceptual may be copied or distributed,
transmitted, transcribed, stored in a retrieval system
or translated into any human or computer language in any
form by any means, electronic, mechanical, manual or
other-wise, or disclosed to third parties without the
express written permission of Imagination Technologies
Limited, Unit 8, HomePark Industrial Estate,
King's Langley, Hertfordshire, WD4 8LZ, U.K.
@Platform generic
@Description User side memory allocation and remapping functions/entrypoints.
@DoxygenVer
******************************************************************************/
/******************************************************************************
Modifications :-
$Log: memory.c $
*****************************************************************************/
#include "services.h"
/*!
******************************************************************************
@Function PVRSRVDeviceRemapMemInfo
@Description
This function will take the supplied MEM_INFO and the device which owns that memory
and create a remapping as defined by the flags, potentially into the memory space of
target device, and return that remapped address in the pointer to the remapped address
This function would be typically used to derive from one 'device' address another
'device' address
The function does not return a second MEM_INFO structure because the mem_info's
are owned by the creating device and having two mem_info's (on different devices)
referencing the same memory could cause contention.
If the TargetDevice is NULL the the memory would be remapped into another address space or range
addressable by the same device
@Input *psOwningDevData :
@Input *psMemInfo :
@Input uFlags :
@Input *psTargetDevData :
@Output *pui32RemappedAddr :
@Return PVRSRV_ERROR :
******************************************************************************/
PVRSRV_ERROR IMG_CALLCONV PVRSRVDeviceRemapMemInfo(PVRDevData *psOwningDevData,
MEM_INFO *psMemInfo,
IMG_UINT32 uFlags,
PVRDevData *psTargetDevData,
IMG_DEV_ADDR *puRemappedAddr)
{
IMG_UINT32 ui32RemappedAddr;
ASSERT(psOwningDevData);
ASSERT(psMemInfo);
ASSERT(psTargetDevData);
ASSERT(puRemappedAddr);
if (psTargetDevData->sDevLocation.bMMUEnabled)
{
/* MMU is enabled for this device - use the DevVirtual address */
/* This should be one of the few places that casts between memory types */
sMemInfo->uiDevAddr = (psMemBlock->sDevVirtAddr).uiAddr;
}
else
{
/* No MMU in use on this device */
/* This should be one of the few places that casts between memory types */
sMemInfo->uiDevAddr = (psMemBlock->sCPUPhysAddr).uiAddr - /*! @todo what is the offset here ?*/;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -