lib/sw_services/xilsem/src/client/xsem_client_api.c
XStatus XSem_RegisterEvent(XIpiPsu *IpiInst, XSem_Notifier* Notifier)
{
	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 == Notifier) {
		XSem_Dbg("[%s] ERROR: Notifier is NULL\n\r", __func__);
		goto END;
	}

	/* Flag will decide to enable/disable event */
	PACK_PAYLOAD4(Payload, CMD_EM_EVENT_REGISTER, Notifier->Module,
			Notifier->Event, Notifier->Flag);

	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;
	}

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

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function is used to register/un-register event
 *		notification with XilSEM Server.
 *		Primarily this function sends an IPI request to PLM to invoke
 *		SEM Event Notifier registration, waits for PLM to process the
 *		request and check the status.
 *
 * @param[in]	IpiInst		Pointer to IPI driver instance
 * @param[in]	Notifier	Pointer of the notifier object to be associated
 * 		with the requested notification
 *
 * @return	This API returns the success or failure.
 *		- XST_FAILURE: On event registration/un-registration failure
 *		- XST_SUCCESS: On event registration/un-registration success
 *
 * @note	The caller shall initialize the notifier object before invoking
 *		the XSem_RegisterEvent function.
 *
 *****************************************************************************/
@brief       This function is used to register/un-register event
notification with XilSEM Server.
Primarily this function sends an IPI request to PLM to invoke
SEM Event Notifier registration, waits for PLM to process the
request and check the status.

@param[in]   IpiInst         Pointer to IPI driver instance
@param[in]   Notifier        Pointer of the notifier object to be associated
with the requested notification

@return      This API returns the success or failure.

@note        The caller shall initialize the notifier object before invoking
the XSem_RegisterEvent function.
@brief This function is used to register / un - register event notification with XilSEM Server . Primarily this function sends an IPI request to PLM to invoke SEM Event Notifier registration waits for PLM to process the request and check the status . @param [ in ] IpiInst Pointer to IPI driver instance @param [ in ] Notifier Pointer of the notifier object to be associated with the requested notification @return This API returns the success or failure . @note The caller shall initialize the notifier object before invoking the XSem_RegisterEvent function .
XStatus XSem_RegisterEvent(XIpiPsu *IpiInst, XSem_Notifier* Notifier)
{
	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 == Notifier) {
		XSem_Dbg("[%s] ERROR: Notifier is NULL\n\r", __func__);
		goto END;
	}
	PACK_PAYLOAD4(Payload, CMD_EM_EVENT_REGISTER, Notifier->Module,
			Notifier->Event, Notifier->Flag);
	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;
	}
	XSem_Dbg("[%s] SUCCESS: 0x%x\n\r", __func__, Status);
END:
	return Status;
}
XStatus XSem_RegisterEvent ( XIpiPsu * IpiInst , XSem_Notifier * Notifier ) { 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 == Notifier ) { XSem_Dbg ( " \n \r " , __func__ ) ; goto END ; } PACK_PAYLOAD4 ( Payload , CMD_EM_EVENT_REGISTER , Notifier -> Module , Notifier -> Event , Notifier -> Flag ) ; 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 ; } XSem_Dbg ( " \n \r " , __func__ , Status ) ; END : return Status ; }
@brief       This function is used to register/un-register event
              notification with XilSEM Server.
@brief This function is used to register / un - register event notification with XilSEM Server .
/* Flag will decide to enable/disable event */