📄 register.h
字号:
/***************************************************************************
* Name : register.cpp
* Title : MBX WinCE driver
* Author(s) : Imagination Technologies
* Created : 6th January 2003
*
* Copyright : 2003 by Imagination Technologies. 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.
*
* Description : MBX WinCE driver
*
* Platform : WinCE
*
* Modifications:-
* $Log: register.h $
*
* --- Revision Logs Removed ---
*
*
****************************************************************************/
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#include "simblt.h"
#include "syscommon.h"
/*
Register access functions
*/
IMG_VOID WriteRegUlong ( PPVRSRV_DEV_INFO psDevInfo, IMG_UINT32 ui32Offset, IMG_UINT32 ui32Value );
IMG_UINT32 ReadRegUlong ( PPVRSRV_DEV_INFO psDevInfo, IMG_UINT32 ui32Offset );
/*
2D Slaveport functions
*/
INLINE IMG_VOID Write2DSlavePort(PPVRSRV_DEV_INFO psDevInfo, IMG_UINT32 ui32Data)
{
PDUMPSP(PDUMPTAGS_SP_MBX_2D, psDevInfo->sDevMem.ui32SP2DDataOffset, ui32Data);
// ASSERTMSG((L"Write to 2D slaveport failure as Core is disabled"), (DevCoreQuery(psDevInfo, DEV_CORE_MBX_2D) == TRUE));
#ifdef SW_SIM
BltSlaveData(ui32Data);
#else
*(IMG_PUINT32)(psDevInfo->sDevMem.ui32SPLinearBase
+ MBX_TA_SP_2D_DATA_OFFSET
+ psDevInfo->sDevMem.ui32SP2DDataOffset)
= ui32Data;
#endif
psDevInfo->sDevMem.ui32SP2DDataOffset += 4;
psDevInfo->sDevMem.ui32SP2DDataOffset %= DEVICE_SP_WRAP_SIZE;
};
__inline IMG_VOID Write2DSlavePortRepeat(PPVRSRV_DEV_INFO psDevInfo, IMG_PUINT32 pui32Data, IMG_UINT32 ui32Count)
{
while (ui32Count)
{
IMG_UINT32 ui32Segment, ui32Available;
IMG_UINT32 ui32Idx;
ui32Segment = 4*ui32Count;
ui32Available = DEVICE_SP_WRAP_SIZE - psDevInfo->sDevMem.ui32SP2DDataOffset;
if (ui32Available < ui32Segment)
{
ui32Segment = ui32Available;
}
for (ui32Idx=0; ui32Idx<ui32Segment/4; ui32Idx++)
{
PDUMPSP(PDUMPTAGS_SP_MBX_2D, psDevInfo->sDevMem.ui32SP2DDataOffset + 4*ui32Idx, pui32Data[ui32Idx]);
#ifdef SW_SIM
BltSlaveData(pui32Data[ui32Idx]);
#else
((IMG_PUINT32)(psDevInfo->sDevMem.ui32SPLinearBase
+ MBX_TA_SP_2D_DATA_OFFSET
+ psDevInfo->sDevMem.ui32SP2DDataOffset))[ui32Idx] = pui32Data[ui32Idx];
#endif
}
pui32Data += ui32Segment/4;
ui32Count -= ui32Segment/4;
psDevInfo->sDevMem.ui32SP2DDataOffset += ui32Segment;
psDevInfo->sDevMem.ui32SP2DDataOffset %= DEVICE_SP_WRAP_SIZE;
}
};
#ifdef __cplusplus
}
#endif
/********************************** end of file ******************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -