lib/sw_services/xilsem/src/client/xsem_client_api.c
XStatus XSem_CmdCfrNjctErr (XIpiPsu *IpiInst, \
			XSemCfrErrInjData *ErrDetail, \
			XSemIpiResp *Resp)
{
	XStatus Status = XST_FAILURE;
	u32 Payload[PAYLOAD_ARG_CNT] = {0U};
	u32 Response[RESPONSE_ARG_CNT] = {0U};

	if (NULL == IpiInst) {
		XSem_Dbg("[%s] ERROR: IpiInst is NULL\n\r", __func__);
		goto END;
	}

	if (NULL == ErrDetail) {
		XSem_Dbg("[%s] ERROR: ErrDetailStruct is NULL\n\r", __func__);
		goto END;
	}

	if (NULL == Resp) {
		XSem_Dbg("[%s] ERROR: Resp is NULL\n\r", __func__);
		goto END;
	}

	PACK_PAYLOAD5(Payload, CMD_ID_CFR_NJCT_ERR, ErrDetail->Efar,
			ErrDetail->Qword, ErrDetail->Bit, ErrDetail->Row);

	Status = XSem_IpiSendReqPlm(IpiInst, Payload);
	if (XST_SUCCESS != Status){
		XSem_Dbg("[%s] ERROR: XSem_IpiSendReqPlm failed with " \
				"ErrCode 0x%x\n\r", __func__, Status);
		goto END;
	}

	Status = XSem_IpiPlmRespMsg(IpiInst, Response);
	if (XST_SUCCESS != Status){
		XSem_Dbg("[%s] ERROR: XSem_IpiPlmRespMsg failed with " \
				"ErrCode 0x%x\n\r", __func__, Status);
		goto END;
	}

	Resp->RespMsg1 = Response[1U];
	Resp->RespMsg2 = Response[2U];

	XSem_Dbg("[%s] SUCCESS: 0x%x\n\r", __func__, Status);

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function is used to inject an error at a valid location in
 *		CRAM from user application.
 *		Primarily this function sends an IPI request to PLM to perform
 *		error injection in CRAM with user provided arguments in
 *		*ErrDetail, waits for PLM to process the request and reads
 *		the response message.
 *
 * @param[in]	IpiInst		Pointer to IPI driver instance
 * @param[in]	ErrDetail	Structure Pointer with Error Injection details
 * @param[out]	Resp		Structure Pointer of IPI response.
 *		- Resp->RespMsg1: Acknowledgment ID of CRAM error injection
 *		- Resp->RespMsg2: Status of CRAM error injection
 *
 * @return	This API returns the success or failure.
 *		- XST_FAILURE: On CRAM error injection failure
 *		- XST_SUCCESS: On CRAM error injection success
 *****************************************************************************/
@brief       This function is used to inject an error at a valid location in
CRAM from user application.
Primarily this function sends an IPI request to PLM to perform
error injection in CRAM with user provided arguments in
*ErrDetail, waits for PLM to process the request and reads
the response message.

@param[in]   IpiInst         Pointer to IPI driver instance
@param[in]   ErrDetail       Structure Pointer with Error Injection details
@param[out]  Resp            Structure Pointer of IPI response.
- Resp->RespMsg1: Acknowledgment ID of CRAM error injection
- Resp->RespMsg2: Status of CRAM error injection

@return      This API returns the success or failure.
- XST_FAILURE: On CRAM error injection failure
- XST_SUCCESS: On CRAM error injection success
@brief This function is used to inject an error at a valid location in CRAM from user application . Primarily this function sends an IPI request to PLM to perform error injection in CRAM with user provided arguments in * ErrDetail waits for PLM to process the request and reads the response message . @param [ in ] IpiInst Pointer to IPI driver instance @param [ in ] ErrDetail Structure Pointer with Error Injection details @param [ out ] Resp Structure Pointer of IPI response . - Resp - > RespMsg1 : Acknowledgment ID of CRAM error injection - Resp - > RespMsg2 : Status of CRAM error injection @return This API returns the success or failure . - XST_FAILURE : On CRAM error injection failure - XST_SUCCESS : On CRAM error injection success
XStatus XSem_CmdCfrNjctErr (XIpiPsu *IpiInst, \
			XSemCfrErrInjData *ErrDetail, \
			XSemIpiResp *Resp)
{
	XStatus Status = XST_FAILURE;
	u32 Payload[PAYLOAD_ARG_CNT] = {0U};
	u32 Response[RESPONSE_ARG_CNT] = {0U};
	if (NULL == IpiInst) {
		XSem_Dbg("[%s] ERROR: IpiInst is NULL\n\r", __func__);
		goto END;
	}
	if (NULL == ErrDetail) {
		XSem_Dbg("[%s] ERROR: ErrDetailStruct is NULL\n\r", __func__);
		goto END;
	}
	if (NULL == Resp) {
		XSem_Dbg("[%s] ERROR: Resp is NULL\n\r", __func__);
		goto END;
	}
	PACK_PAYLOAD5(Payload, CMD_ID_CFR_NJCT_ERR, ErrDetail->Efar,
			ErrDetail->Qword, ErrDetail->Bit, ErrDetail->Row);
	Status = XSem_IpiSendReqPlm(IpiInst, Payload);
	if (XST_SUCCESS != Status){
		XSem_Dbg("[%s] ERROR: XSem_IpiSendReqPlm failed with " \
				"ErrCode 0x%x\n\r", __func__, Status);
		goto END;
	}
	Status = XSem_IpiPlmRespMsg(IpiInst, Response);
	if (XST_SUCCESS != Status){
		XSem_Dbg("[%s] ERROR: XSem_IpiPlmRespMsg failed with " \
				"ErrCode 0x%x\n\r", __func__, Status);
		goto END;
	}
	Resp->RespMsg1 = Response[1U];
	Resp->RespMsg2 = Response[2U];
	XSem_Dbg("[%s] SUCCESS: 0x%x\n\r", __func__, Status);
END:
	return Status;
}
XStatus XSem_CmdCfrNjctErr ( XIpiPsu * IpiInst , XSemCfrErrInjData * ErrDetail , XSemIpiResp * Resp ) { XStatus Status = XST_FAILURE ; u32 Payload [ PAYLOAD_ARG_CNT ] = { 0U } ; u32 Response [ RESPONSE_ARG_CNT ] = { 0U } ; if ( NULL == IpiInst ) { XSem_Dbg ( " \n \r " , __func__ ) ; goto END ; } if ( NULL == ErrDetail ) { XSem_Dbg ( " \n \r " , __func__ ) ; goto END ; } if ( NULL == Resp ) { XSem_Dbg ( " \n \r " , __func__ ) ; goto END ; } PACK_PAYLOAD5 ( Payload , CMD_ID_CFR_NJCT_ERR , ErrDetail -> Efar , ErrDetail -> Qword , ErrDetail -> Bit , ErrDetail -> Row ) ; Status = XSem_IpiSendReqPlm ( IpiInst , Payload ) ; if ( XST_SUCCESS != Status ) { XSem_Dbg ( " " " \n \r " , __func__ , Status ) ; goto END ; } Status = XSem_IpiPlmRespMsg ( IpiInst , Response ) ; if ( XST_SUCCESS != Status ) { XSem_Dbg ( " " " \n \r " , __func__ , Status ) ; goto END ; } Resp -> RespMsg1 = Response [ 1U ] ; Resp -> RespMsg2 = Response [ 2U ] ; XSem_Dbg ( " \n \r " , __func__ , Status ) ; END : return Status ; }
@brief       This function is used to inject an error at a valid location in
              CRAM from user application.
@brief This function is used to inject an error at a valid location in CRAM from user application .