本文整理汇总了C++中SysAcquireData函数的典型用法代码示例。如果您正苦于以下问题:C++ SysAcquireData函数的具体用法?C++ SysAcquireData怎么用?C++ SysAcquireData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SysAcquireData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OSMapPhysToLin
/*!
******************************************************************************
@Function SysCreateVersionString
@Description Read the version string
@Return IMG_CHAR * : Version string
******************************************************************************/
static IMG_CHAR *SysCreateVersionString(void)
{
static IMG_CHAR aszVersionString[100];
SYS_DATA *psSysData;
IMG_UINT32 ui32SGXRevision;
IMG_INT32 i32Count;
#if !defined(NO_HARDWARE)
IMG_VOID *pvRegsLinAddr;
pvRegsLinAddr = OSMapPhysToLin(gsSGXDeviceMap.sRegsCpuPBase,
gsSGXDeviceMap.ui32RegsSize,
PVRSRV_HAP_UNCACHED|PVRSRV_HAP_KERNEL_ONLY,
IMG_NULL);
if(!pvRegsLinAddr)
{
return IMG_NULL;
}
#if SGX_CORE_REV == 105
ui32SGXRevision = 0x10005;
#else
ui32SGXRevision = OSReadHWReg((IMG_PVOID)((IMG_PBYTE)pvRegsLinAddr),
EUR_CR_CORE_REVISION);
#endif
#else
ui32SGXRevision = 0;
#endif
SysAcquireData(&psSysData);
i32Count = OSSNPrintf(aszVersionString, 100,
"SGX revision = %u.%u.%u",
(IMG_UINT)((ui32SGXRevision & EUR_CR_CORE_REVISION_MAJOR_MASK)
>> EUR_CR_CORE_REVISION_MAJOR_SHIFT),
(IMG_UINT)((ui32SGXRevision & EUR_CR_CORE_REVISION_MINOR_MASK)
>> EUR_CR_CORE_REVISION_MINOR_SHIFT),
(IMG_UINT)((ui32SGXRevision & EUR_CR_CORE_REVISION_MAINTENANCE_MASK)
>> EUR_CR_CORE_REVISION_MAINTENANCE_SHIFT)
);
#if !defined(NO_HARDWARE)
OSUnMapPhysToLin(pvRegsLinAddr,
SYS_OMAP5430_SGX_REGS_SIZE,
PVRSRV_HAP_UNCACHED|PVRSRV_HAP_KERNEL_ONLY,
IMG_NULL);
#endif
if(i32Count == -1)
{
return IMG_NULL;
}
return aszVersionString;
}
示例2: PVRSRVScheduleDeviceCallbacks
/*!
******************************************************************************
@Function PVRSRVScheduleDeviceCallbacks
@Description Schedule all device callbacks
@Return IMG_VOID
******************************************************************************/
IMG_VOID PVRSRVScheduleDeviceCallbacks(IMG_VOID)
{
SYS_DATA *psSysData;
/* PVRSRV_DEVICE_NODE *psDeviceNode;*/
SysAcquireData(&psSysData);
/*for all the device, invoke the callback function*/
List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
&PVRSRVCommandCompleteCallbacks_ForEachCb);
}
示例3: SysPowerLockWrap
PVRSRV_ERROR SysPowerLockWrap(IMG_BOOL bTryLock)
{
#if 0
SYS_DATA *psSysData;
SysAcquireData(&psSysData);
return PowerLockWrap(psSysData->pvSysSpecificData, bTryLock);
#else
return PVRSRV_OK;
#endif
}
示例4: PVRSRVInitialiseDevice
/*!
******************************************************************************
@Function PVRSRVInitialiseDevice
@Description
initialises device by index
@Input ui32DevIndex : Index to the required device
@Return PVRSRV_ERROR :
******************************************************************************/
PVRSRV_ERROR IMG_CALLCONV PVRSRVInitialiseDevice (IMG_UINT32 ui32DevIndex)
{
PVRSRV_DEVICE_NODE *psDeviceNode;
SYS_DATA *psSysData;
PVRSRV_ERROR eError;
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVInitialiseDevice"));
SysAcquireData(&psSysData);
/* Find device in the list */
psDeviceNode = (PVRSRV_DEVICE_NODE*)
List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
&MatchDeviceKM_AnyVaCb,
ui32DevIndex,
IMG_TRUE);
if(!psDeviceNode)
{
/* Devinfo not in the list */
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: requested device is not present"));
return PVRSRV_ERROR_INIT_FAILURE;
}
/*
FoundDevice:
*/
PVR_ASSERT (psDeviceNode->ui32RefCount > 0);
/*
Create the device's resource manager context.
*/
eError = PVRSRVResManConnect(IMG_NULL, &psDeviceNode->hResManContext);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: Failed PVRSRVResManConnect call"));
return eError;
}
/* Initialise the device */
if(psDeviceNode->pfnInitDevice != IMG_NULL)
{
eError = psDeviceNode->pfnInitDevice(psDeviceNode);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInitialiseDevice: Failed InitDevice call"));
return eError;
}
}
return PVRSRV_OK;
}
示例5: PVRSRVDevicePreClockSpeedChange
PVRSRV_ERROR PVRSRVDevicePreClockSpeedChange(IMG_UINT32 ui32DeviceIndex,
IMG_BOOL bIdleDevice,
IMG_VOID *pvInfo)
{
PVRSRV_ERROR eError = PVRSRV_OK;
SYS_DATA *psSysData;
PVRSRV_POWER_DEV *psPowerDevice;
PVR_UNREFERENCED_PARAMETER(pvInfo);
SysAcquireData(&psSysData);
if (bIdleDevice)
{
eError = PVRSRVPowerLock(KERNEL_ID, IMG_FALSE);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "PVRSRVDevicePreClockSpeedChange : failed to acquire lock, error:0x%lx", eError));
return eError;
}
}
psPowerDevice = (PVRSRV_POWER_DEV*)
List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
MatchPowerDeviceIndex_AnyVaCb,
ui32DeviceIndex);
if (psPowerDevice && psPowerDevice->pfnPostClockSpeedChange)
{
eError = psPowerDevice->pfnPreClockSpeedChange(psPowerDevice->hDevCookie,
bIdleDevice,
psPowerDevice->eCurrentPowerState);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,
"PVRSRVDevicePreClockSpeedChange : Device %lu failed, error:0x%lx",
ui32DeviceIndex, eError));
}
}
if (bIdleDevice && eError != PVRSRV_OK)
{
PVRSRVPowerUnlock(KERNEL_ID);
}
return eError;
}
示例6: PVRSRVInitialiseDevice
enum PVRSRV_ERROR PVRSRVInitialiseDevice(u32 ui32DevIndex)
{
struct PVRSRV_DEVICE_NODE *psDeviceNode;
struct SYS_DATA *psSysData;
enum PVRSRV_ERROR eError;
PVR_DPF(PVR_DBG_MESSAGE, "PVRSRVInitialiseDevice");
eError = SysAcquireData(&psSysData);
if (eError != PVRSRV_OK) {
PVR_DPF(PVR_DBG_ERROR,
"PVRSRVInitialiseDevice: Failed to get SysData");
return eError;
}
psDeviceNode = psSysData->psDeviceNodeList;
while (psDeviceNode) {
if (psDeviceNode->sDevId.ui32DeviceIndex == ui32DevIndex)
goto FoundDevice;
psDeviceNode = psDeviceNode->psNext;
}
PVR_DPF(PVR_DBG_ERROR,
"PVRSRVInitialiseDevice: requested device is not present");
return PVRSRV_ERROR_INIT_FAILURE;
FoundDevice:
PVR_ASSERT(psDeviceNode->ui32RefCount > 0);
eError = PVRSRVResManConnect(NULL, &psDeviceNode->hResManContext);
if (eError != PVRSRV_OK) {
PVR_DPF(PVR_DBG_ERROR, "PVRSRVInitialiseDevice: "
"Failed PVRSRVResManConnect call");
return eError;
}
if (psDeviceNode->pfnInitDevice != NULL) {
eError = psDeviceNode->pfnInitDevice(psDeviceNode);
if (eError != PVRSRV_OK) {
PVR_DPF(PVR_DBG_ERROR, "PVRSRVInitialiseDevice: "
"Failed InitDevice call");
return eError;
}
}
return PVRSRV_OK;
}
示例7: PVRSRVFinaliseSystem
PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful)
{
SYS_DATA *psSysData;
PVRSRV_ERROR eError;
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVFinaliseSystem"));
SysAcquireData(&psSysData);
if (bInitSuccessful)
{
eError = SysFinalise();
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVFinaliseSystem: SysFinalise failed (%d)", eError));
return eError;
}
eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
PVRSRVFinaliseSystem_SetPowerState_AnyCb);
if (eError != PVRSRV_OK)
{
return eError;
}
eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
PVRSRVFinaliseSystem_CompatCheck_AnyCb);
if (eError != PVRSRV_OK)
{
return eError;
}
}
#if !defined(SUPPORT_DRI_DRM)
PDUMPENDINITPHASE();
#endif
return PVRSRV_OK;
}
示例8: PVRSRVSystemPrePowerStateKM
enum PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(
enum PVR_POWER_STATE eNewPowerState)
{
enum PVRSRV_ERROR eError;
struct SYS_DATA *psSysData;
enum PVR_POWER_STATE eNewDevicePowerState;
eError = SysAcquireData(&psSysData);
if (eError != PVRSRV_OK)
return eError;
eError = PVRSRVPowerLock(KERNEL_ID, IMG_TRUE);
if (eError != PVRSRV_OK)
return eError;
if (_IsSystemStatePowered(eNewPowerState) !=
_IsSystemStatePowered(psSysData->eCurrentPowerState)) {
if (_IsSystemStatePowered(eNewPowerState))
eNewDevicePowerState = PVRSRV_POWER_Unspecified;
else
eNewDevicePowerState = PVRSRV_POWER_STATE_D3;
eError = PVRSRVDevicePrePowerStateKM(IMG_TRUE, 0,
eNewDevicePowerState);
if (eError != PVRSRV_OK)
goto ErrorExit;
}
if (eNewPowerState != psSysData->eCurrentPowerState) {
eError = SysSystemPrePowerState(eNewPowerState);
if (eError != PVRSRV_OK)
goto ErrorExit;
}
return eError;
ErrorExit:
PVR_DPF(PVR_DBG_ERROR, "PVRSRVSystemPrePowerStateKM: "
"Transition from %d to %d FAILED 0x%x",
psSysData->eCurrentPowerState, eNewPowerState, eError);
psSysData->eFailedPowerState = eNewPowerState;
PVRSRVPowerUnlock(KERNEL_ID);
return eError;
}
示例9: PVRSRVAcquireDeviceDataKM
enum PVRSRV_ERROR PVRSRVAcquireDeviceDataKM(u32 ui32DevIndex,
enum PVRSRV_DEVICE_TYPE eDeviceType,
void **phDevCookie)
{
struct PVRSRV_DEVICE_NODE *psDeviceNode;
struct SYS_DATA *psSysData;
enum PVRSRV_ERROR eError;
PVR_DPF(PVR_DBG_MESSAGE, "PVRSRVAcquireDeviceDataKM");
eError = SysAcquireData(&psSysData);
if (eError != PVRSRV_OK) {
PVR_DPF(PVR_DBG_ERROR,
"PVRSRVAcquireDeviceDataKM: Failed to get SysData");
return eError;
}
psDeviceNode = psSysData->psDeviceNodeList;
if (eDeviceType != PVRSRV_DEVICE_TYPE_UNKNOWN) {
while (psDeviceNode) {
if (psDeviceNode->sDevId.eDeviceType == eDeviceType)
goto FoundDevice;
psDeviceNode = psDeviceNode->psNext;
}
} else {
while (psDeviceNode) {
if (psDeviceNode->sDevId.ui32DeviceIndex ==
ui32DevIndex) {
goto FoundDevice;
}
psDeviceNode = psDeviceNode->psNext;
}
}
PVR_DPF(PVR_DBG_ERROR,
"PVRSRVAcquireDeviceDataKM: requested device is not present");
return PVRSRV_ERROR_INIT_FAILURE;
FoundDevice:
PVR_ASSERT(psDeviceNode->ui32RefCount > 0);
if (phDevCookie)
*phDevCookie = (void *) psDeviceNode;
return PVRSRV_OK;
}
示例10: PVRSRVSystemPostPowerStateKM
enum PVRSRV_ERROR PVRSRVSystemPostPowerStateKM(
enum PVR_POWER_STATE eNewPowerState)
{
enum PVRSRV_ERROR eError;
struct SYS_DATA *psSysData;
enum PVR_POWER_STATE eNewDevicePowerState;
eError = SysAcquireData(&psSysData);
if (eError != PVRSRV_OK)
goto Exit;
if (eNewPowerState != psSysData->eCurrentPowerState) {
eError = SysSystemPostPowerState(eNewPowerState);
if (eError != PVRSRV_OK)
goto Exit;
}
if (_IsSystemStatePowered(eNewPowerState) !=
_IsSystemStatePowered(psSysData->eCurrentPowerState)) {
if (_IsSystemStatePowered(eNewPowerState))
eNewDevicePowerState = PVRSRV_POWER_Unspecified;
else
eNewDevicePowerState = PVRSRV_POWER_STATE_D3;
eError =
PVRSRVDevicePostPowerStateKM(IMG_TRUE, 0,
eNewDevicePowerState);
if (eError != PVRSRV_OK)
goto Exit;
}
PVR_DPF(PVR_DBG_WARNING, "PVRSRVSystemPostPowerStateKM: "
"System Power Transition from %d to %d OK",
psSysData->eCurrentPowerState, eNewPowerState);
psSysData->eCurrentPowerState = eNewPowerState;
Exit:
PVRSRVPowerUnlock(KERNEL_ID);
if (_IsSystemStatePowered(eNewPowerState) &&
PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL))
PVRSRVCommandCompleteCallbacks();
return eError;
}
示例11: PVRSRVRegisterPowerDevice
enum PVRSRV_ERROR PVRSRVRegisterPowerDevice(u32 ui32DeviceIndex,
enum PVRSRV_ERROR (*pfnPrePower)(void *, enum PVR_POWER_STATE,
enum PVR_POWER_STATE),
enum PVRSRV_ERROR (*pfnPostPower)(void *, enum PVR_POWER_STATE,
enum PVR_POWER_STATE),
enum PVRSRV_ERROR (*pfnPreClockSpeedChange)(void *, IMG_BOOL,
enum PVR_POWER_STATE),
enum PVRSRV_ERROR (*pfnPostClockSpeedChange)(void *, IMG_BOOL,
enum PVR_POWER_STATE),
void *hDevCookie, enum PVR_POWER_STATE eCurrentPowerState,
enum PVR_POWER_STATE eDefaultPowerState)
{
enum PVRSRV_ERROR eError;
struct SYS_DATA *psSysData;
struct PVRSRV_POWER_DEV *psPowerDevice;
if (pfnPrePower == NULL && pfnPostPower == NULL)
return PVRSRVRemovePowerDevice(ui32DeviceIndex);
eError = SysAcquireData(&psSysData);
if (eError != PVRSRV_OK)
return eError;
eError = OSAllocMem(PVRSRV_OS_PAGEABLE_HEAP,
sizeof(struct PVRSRV_POWER_DEV),
(void **) &psPowerDevice, NULL);
if (eError != PVRSRV_OK) {
PVR_DPF(PVR_DBG_ERROR, "PVRSRVRegisterPowerDevice: "
"Failed to alloc struct PVRSRV_POWER_DEV");
return eError;
}
psPowerDevice->pfnPrePower = pfnPrePower;
psPowerDevice->pfnPostPower = pfnPostPower;
psPowerDevice->pfnPreClockSpeedChange = pfnPreClockSpeedChange;
psPowerDevice->pfnPostClockSpeedChange = pfnPostClockSpeedChange;
psPowerDevice->hDevCookie = hDevCookie;
psPowerDevice->ui32DeviceIndex = ui32DeviceIndex;
psPowerDevice->eCurrentPowerState = eCurrentPowerState;
psPowerDevice->eDefaultPowerState = eDefaultPowerState;
psPowerDevice->psNext = psSysData->psPowerDeviceList;
psSysData->psPowerDeviceList = psPowerDevice;
return PVRSRV_OK;
}
示例12: PVRSRVRegisterPowerDevice
PVRSRV_ERROR PVRSRVRegisterPowerDevice(IMG_UINT32 ui32DeviceIndex,
PFN_PRE_POWER pfnPrePower,
PFN_POST_POWER pfnPostPower,
PFN_PRE_CLOCKSPEED_CHANGE pfnPreClockSpeedChange,
PFN_POST_CLOCKSPEED_CHANGE pfnPostClockSpeedChange,
IMG_HANDLE hDevCookie,
PVRSRV_DEV_POWER_STATE eCurrentPowerState,
PVRSRV_DEV_POWER_STATE eDefaultPowerState)
{
PVRSRV_ERROR eError;
SYS_DATA *psSysData;
PVRSRV_POWER_DEV *psPowerDevice;
if (pfnPrePower == IMG_NULL &&
pfnPostPower == IMG_NULL)
{
return PVRSRVRemovePowerDevice(ui32DeviceIndex);
}
SysAcquireData(&psSysData);
eError = OSAllocMem( PVRSRV_OS_PAGEABLE_HEAP,
sizeof(PVRSRV_POWER_DEV),
(IMG_VOID **)&psPowerDevice, IMG_NULL,
"Power Device");
if(eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterPowerDevice: Failed to alloc PVRSRV_POWER_DEV"));
return eError;
}
psPowerDevice->pfnPrePower = pfnPrePower;
psPowerDevice->pfnPostPower = pfnPostPower;
psPowerDevice->pfnPreClockSpeedChange = pfnPreClockSpeedChange;
psPowerDevice->pfnPostClockSpeedChange = pfnPostClockSpeedChange;
psPowerDevice->hDevCookie = hDevCookie;
psPowerDevice->ui32DeviceIndex = ui32DeviceIndex;
psPowerDevice->eCurrentPowerState = eCurrentPowerState;
psPowerDevice->eDefaultPowerState = eDefaultPowerState;
List_PVRSRV_POWER_DEV_Insert(&(psSysData->psPowerDeviceList), psPowerDevice);
return (PVRSRV_OK);
}
示例13: PVRSRVDevicePreClockSpeedChange
enum PVRSRV_ERROR PVRSRVDevicePreClockSpeedChange(u32 ui32DeviceIndex,
IMG_BOOL bIdleDevice,
void *pvInfo)
{
enum PVRSRV_ERROR eError = PVRSRV_OK;
struct SYS_DATA *psSysData;
struct PVRSRV_POWER_DEV *psPowerDevice;
PVR_UNREFERENCED_PARAMETER(pvInfo);
eError = SysAcquireData(&psSysData);
if (eError != PVRSRV_OK)
return eError;
psPowerDevice = psSysData->psPowerDeviceList;
while (psPowerDevice) {
if (ui32DeviceIndex == psPowerDevice->ui32DeviceIndex)
if (psPowerDevice->pfnPreClockSpeedChange) {
eError =
psPowerDevice->
pfnPreClockSpeedChange(psPowerDevice->
hDevCookie,
bIdleDevice,
psPowerDevice->
eCurrentPowerState);
if (eError != PVRSRV_OK) {
pr_err
("pfnPreClockSpeedChange failed\n");
PVR_DPF(PVR_DBG_ERROR,
"PVRSRVDevicePreClockSpeedChange : "
"Device %lu failed, error:0x%lx",
ui32DeviceIndex, eError);
break;
}
}
psPowerDevice = psPowerDevice->psNext;
}
if (bIdleDevice && eError != PVRSRV_OK)
PVRSRVPowerUnlock(KERNEL_ID);
return eError;
}
示例14: PVRSRVDevicePostPowerStateKM
static
PVRSRV_ERROR PVRSRVDevicePostPowerStateKM(IMG_BOOL bAllDevices,
IMG_UINT32 ui32DeviceIndex,
PVRSRV_DEV_POWER_STATE eNewPowerState)
{
PVRSRV_ERROR eError;
SYS_DATA *psSysData;
SysAcquireData(&psSysData);
eError = List_PVRSRV_POWER_DEV_PVRSRV_ERROR_Any_va(psSysData->psPowerDeviceList,
PVRSRVDevicePostPowerStateKM_AnyVaCb,
bAllDevices,
ui32DeviceIndex,
eNewPowerState);
return eError;
}
示例15: PVRSRVFinaliseSystem
/*!
******************************************************************************
@Function PVRSRVFinaliseSystem
@Description
Final part of system initialisation.
@Input ui32DevIndex : Index to the required device
@Return PVRSRV_ERROR :
******************************************************************************/
PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful)
{
/* PVRSRV_DEVICE_NODE *psDeviceNode;*/
SYS_DATA *psSysData;
PVRSRV_ERROR eError;
PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVFinaliseSystem"));
SysAcquireData(&psSysData);
if (bInitSuccessful)
{
eError = SysFinalise();
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR,"PVRSRVFinaliseSystem: SysFinalise failed (%d)", eError));
return eError;
}
/* Place all devices into their default power state. */
eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
&PVRSRVFinaliseSystem_SetPowerState_AnyCb);
if (eError != PVRSRV_OK)
{
return eError;
}
/* Verify microkernel compatibility for devices */
eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList,
&PVRSRVFinaliseSystem_CompatCheck_AnyCb);
if (eError != PVRSRV_OK)
{
return eError;
}
}
/* Some platforms call this too early in the boot phase. */
PDUMPENDINITPHASE();
return PVRSRV_OK;
}