XilinxProcessorIPLib/drivers/clockps/src/xclockps.h
static inline XStatus XClock_ReadReg(u32 RegAddr, u32 *Value)
{
#if EL1_NONSECURE
	XSmc_OutVar RegValue;

	RegValue = Xil_Smc(MMIO_READ_SMC_FID, (u64)(RegAddr), 0, 0, 0, 0, 0, 0);
	if (0x00 == (RegValue.Arg0 & 0xFFFFFFFF)) {
		*Value = RegValue.Arg0 >> 32;
		return XST_SUCCESS;
	}

	return XST_FAILURE;
#else
	*Value = Xil_In32((u32)RegAddr);
	return XST_SUCCESS;
#endif
}
/***************** Macros (Inline Functions) Definitions *********************/
/****************************************************************************/
/**
* Read the given register.
*
* @param        RegAddr is the address of the register to read
* @param        Value is the pointer to variable holding read value
*
* @return       XST_SUCCESS if successful
* 		XST_FAILURE if unsuccessful
*
* @note         Read from  register may fail in case driver doesn't have proper
* 		access at EL1 NONSECURE
*
******************************************************************************/
Macros (Inline Functions) Definitions
Read the given register.
Macros ( Inline Functions ) Definitions Read the given register .
static inline XStatus XClock_ReadReg(u32 RegAddr, u32 *Value)
{
#if EL1_NONSECURE
	XSmc_OutVar RegValue;
	RegValue = Xil_Smc(MMIO_READ_SMC_FID, (u64)(RegAddr), 0, 0, 0, 0, 0, 0);
	if (0x00 == (RegValue.Arg0 & 0xFFFFFFFF)) {
		*Value = RegValue.Arg0 >> 32;
		return XST_SUCCESS;
	}
	return XST_FAILURE;
#else
	*Value = Xil_In32((u32)RegAddr);
	return XST_SUCCESS;
#endif
}
static inline XStatus XClock_ReadReg ( u32 RegAddr , u32 * Value ) { #if EL1_NONSECURE XSmc_OutVar RegValue ; RegValue = Xil_Smc ( MMIO_READ_SMC_FID , ( u64 ) ( RegAddr ) , 0 , 0 , 0 , 0 , 0 , 0 ) ; if ( 0x00 == ( RegValue . Arg0 & 0xFFFFFFFF ) ) { * Value = RegValue . Arg0 >> 32 ; return XST_SUCCESS ; } return XST_FAILURE ; #else * Value = Xil_In32 ( ( u32 ) RegAddr ) ; return XST_SUCCESS ; #endif }
Macros (Inline Functions) Definitions
Read the given register.
Macros ( Inline Functions ) Definitions Read the given register .