lib/sw_services/xilpm/src/versal/client/pm_callbacks.c
void XPm_NotifierProcessEvent(const u32 Node, const u32 Event,
			      const u32 Oppoint)
{
	XPm_Notifier* Notifier = NULL;
	XStatus Status = (s32)XST_FAILURE;
	u32 ApiVersionServer = XPm_GetRegisterNotifierVersionServer();

	/* Validate the notifier list */
	if (NULL != NotifierList) {
		Notifier = NotifierList;
	}

	while (NULL != Notifier) {
		if ((Node == Notifier->node) &&
		    (((((u32)XST_API_REG_NOTIFIER_VERSION <= ApiVersionServer) && /* For new version of XilPM Server */
		      ((((u32)XPM_NODECLASS_EVENT == NODECLASS(Node)) && (0U != (Event & Notifier->event))) ||
		       (((u32)XPM_NODECLASS_EVENT != NODECLASS(Node)) && (Event == Notifier->event))))) ||
		     (((u32)XST_API_BASE_VERSION == ApiVersionServer) && /* For old version of XilPM Server */
		      (Event == Notifier->event)))) {
			Notifier->oppoint = Oppoint;
			Notifier->received++;
			Notifier->received_event = Notifier->event & Event;

			if (NULL != Notifier->callback) {
				Notifier->callback(Notifier);

				if ((u32)XPM_NODECLASS_EVENT == NODECLASS(Node)) {
					Status = XPm_RegisterNotifier(Notifier);
				        if ((s32)XST_SUCCESS != Status) {
						xil_printf("Re-registration failed Status = %d\n", Status);
					}
				}
			}
			/* There could be multiple pairs with different notifiers */
		}
		Notifier = Notifier->next;
	}
}
/****************************************************************************/
/**
 * @brief  Call to process notification event
 *
 * @param  Node     Device which is the subject of notification
 * @param  Event    Event which is the subject of notification
 * @param  Oppoint  Operating point of the device in question
 *
 * @return None
 *
 * @note   None
 *
 ****************************************************************************/
@brief  Call to process notification event
@param  Node     Device which is the subject of notification
@param  Event    Event which is the subject of notification
@param  Oppoint  Operating point of the device in question

@return None

@note   None
@brief Call to process notification event @param Node Device which is the subject of notification @param Event Event which is the subject of notification @param Oppoint Operating point of the device in question @return None @note None
void XPm_NotifierProcessEvent(const u32 Node, const u32 Event,
			      const u32 Oppoint)
{
	XPm_Notifier* Notifier = NULL;
	XStatus Status = (s32)XST_FAILURE;
	u32 ApiVersionServer = XPm_GetRegisterNotifierVersionServer();
	if (NULL != NotifierList) {
		Notifier = NotifierList;
	}
	while (NULL != Notifier) {
		if ((Node == Notifier->node) &&
		    (((((u32)XST_API_REG_NOTIFIER_VERSION <= ApiVersionServer) && 
		      ((((u32)XPM_NODECLASS_EVENT == NODECLASS(Node)) && (0U != (Event & Notifier->event))) ||
		       (((u32)XPM_NODECLASS_EVENT != NODECLASS(Node)) && (Event == Notifier->event))))) ||
		     (((u32)XST_API_BASE_VERSION == ApiVersionServer) && 
		      (Event == Notifier->event)))) {
			Notifier->oppoint = Oppoint;
			Notifier->received++;
			Notifier->received_event = Notifier->event & Event;
			if (NULL != Notifier->callback) {
				Notifier->callback(Notifier);
				if ((u32)XPM_NODECLASS_EVENT == NODECLASS(Node)) {
					Status = XPm_RegisterNotifier(Notifier);
				        if ((s32)XST_SUCCESS != Status) {
						xil_printf("Re-registration failed Status = %d\n", Status);
					}
				}
			}
		}
		Notifier = Notifier->next;
	}
}
void XPm_NotifierProcessEvent ( const u32 Node , const u32 Event , const u32 Oppoint ) { XPm_Notifier * Notifier = NULL ; XStatus Status = ( s32 ) XST_FAILURE ; u32 ApiVersionServer = XPm_GetRegisterNotifierVersionServer ( ) ; if ( NULL != NotifierList ) { Notifier = NotifierList ; } while ( NULL != Notifier ) { if ( ( Node == Notifier -> node ) && ( ( ( ( ( u32 ) XST_API_REG_NOTIFIER_VERSION <= ApiVersionServer ) && ( ( ( ( u32 ) XPM_NODECLASS_EVENT == NODECLASS ( Node ) ) && ( 0U != ( Event & Notifier -> event ) ) ) || ( ( ( u32 ) XPM_NODECLASS_EVENT != NODECLASS ( Node ) ) && ( Event == Notifier -> event ) ) ) ) ) || ( ( ( u32 ) XST_API_BASE_VERSION == ApiVersionServer ) && ( Event == Notifier -> event ) ) ) ) { Notifier -> oppoint = Oppoint ; Notifier -> received ++ ; Notifier -> received_event = Notifier -> event & Event ; if ( NULL != Notifier -> callback ) { Notifier -> callback ( Notifier ) ; if ( ( u32 ) XPM_NODECLASS_EVENT == NODECLASS ( Node ) ) { Status = XPm_RegisterNotifier ( Notifier ) ; if ( ( s32 ) XST_SUCCESS != Status ) { xil_printf ( " \n " , Status ) ; } } } } Notifier = Notifier -> next ; } }
@brief  Call to process notification event
 @param  Node     Device which is the subject of notification
 @param  Event    Event which is the subject of notification
 @param  Oppoint  Operating point of the device in question
@brief Call to process notification event @param Node Device which is the subject of notification @param Event Event which is the subject of notification @param Oppoint Operating point of the device in question
/* Validate the notifier list */ /* For new version of XilPM Server */ /* For old version of XilPM Server */ /* There could be multiple pairs with different notifiers */