lib/sw_services/xilplmi/src/xplmi_err.c
static int XPlmi_EmConfig(u32 NodeType, u32 ErrorId, u8 ActionId,
		XPlmi_ErrorHandler_t ErrorHandler)
{
	int Status = XST_FAILURE;
	u32 RegMask = XPlmi_ErrRegMask(ErrorId);

	/* Set error action for given error Id */
	switch (ActionId) {
		case XPLMI_EM_ACTION_NONE:
			/* No Action */
			ErrorTable[ErrorId].Action = ActionId;
			Status = XST_SUCCESS;
			break;
		case XPLMI_EM_ACTION_POR:
			/* Set the error action and enable it */
			ErrorTable[ErrorId].Action = ActionId;
			Status = XPlmi_EmEnablePOR(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_SRST:
			/* Set error action SRST for the errorId */
			ErrorTable[ErrorId].Action = ActionId;
			Status = XPlmi_EmEnableSRST(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_CUSTOM:
			/* Set custom handler as error action for the errorId */
			ErrorTable[ErrorId].Action = ActionId;
			ErrorTable[ErrorId].Handler = ErrorHandler;
			Status = XPlmi_EmEnableInt(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_ERROUT:
			ErrorTable[ErrorId].Action = ActionId;
			/* Set error action ERROUT signal for the errorId */
			Status = XPlmi_EmEnablePSError(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_SUBSYS_SHUTDN:
		case XPLMI_EM_ACTION_SUBSYS_RESTART:
			/* Set handler and error action for the errorId */
			ErrorTable[ErrorId].Action = ActionId;
			ErrorTable[ErrorId].Handler = XPlmi_ErrIntrSubTypeHandler;
			ErrorTable[ErrorId].SubsystemId = EmSubsystemId;
			Status = XPlmi_EmEnableInt(NodeType, RegMask);
			break;
		default:
			/* Invalid Action Id */
			Status = XPLMI_INVALID_ERROR_ACTION;
			XPlmi_Printf(DEBUG_GENERAL,
					"Invalid ActionId for Error: 0x%0x\n\r", ErrorId);
			break;
		}

	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function configures the Action specified for a given Error ID.
 *
 * @param	NodeType is the error node type
 * @param	ErrorId is the index of the error to which given action to be set
 * @param	ActionId is the action that need to be set for ErrorId. Action
 * 		  	can be SRST/POR/ERR OUT/INT
 * @param	ErrorHandler If INT is defined as response, handler should be
 * 		  	defined.
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function configures the Action specified for a given Error ID.
@param       NodeType is the error node type
@param       ErrorId is the index of the error to which given action to be set
@param       ActionId is the action that need to be set for ErrorId. Action
can be SRST/POR/ERR OUT/INT
@param       ErrorHandler If INT is defined as response, handler should be
defined.

@return      XST_SUCCESS on success and error code on failure
@brief This function configures the Action specified for a given Error ID . @param NodeType is the error node type @param ErrorId is the index of the error to which given action to be set @param ActionId is the action that need to be set for ErrorId . Action can be SRST / POR / ERR OUT / INT @param ErrorHandler If INT is defined as response handler should be defined . @return XST_SUCCESS on success and error code on failure
static int XPlmi_EmConfig(u32 NodeType, u32 ErrorId, u8 ActionId,
		XPlmi_ErrorHandler_t ErrorHandler)
{
	int Status = XST_FAILURE;
	u32 RegMask = XPlmi_ErrRegMask(ErrorId);
	switch (ActionId) {
		case XPLMI_EM_ACTION_NONE:
			ErrorTable[ErrorId].Action = ActionId;
			Status = XST_SUCCESS;
			break;
		case XPLMI_EM_ACTION_POR:
			ErrorTable[ErrorId].Action = ActionId;
			Status = XPlmi_EmEnablePOR(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_SRST:
			ErrorTable[ErrorId].Action = ActionId;
			Status = XPlmi_EmEnableSRST(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_CUSTOM:
			ErrorTable[ErrorId].Action = ActionId;
			ErrorTable[ErrorId].Handler = ErrorHandler;
			Status = XPlmi_EmEnableInt(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_ERROUT:
			ErrorTable[ErrorId].Action = ActionId;
			Status = XPlmi_EmEnablePSError(NodeType, RegMask);
			break;
		case XPLMI_EM_ACTION_SUBSYS_SHUTDN:
		case XPLMI_EM_ACTION_SUBSYS_RESTART:
			ErrorTable[ErrorId].Action = ActionId;
			ErrorTable[ErrorId].Handler = XPlmi_ErrIntrSubTypeHandler;
			ErrorTable[ErrorId].SubsystemId = EmSubsystemId;
			Status = XPlmi_EmEnableInt(NodeType, RegMask);
			break;
		default:
			Status = XPLMI_INVALID_ERROR_ACTION;
			XPlmi_Printf(DEBUG_GENERAL,
					"Invalid ActionId for Error: 0x%0x\n\r", ErrorId);
			break;
		}
	return Status;
}
static int XPlmi_EmConfig ( u32 NodeType , u32 ErrorId , u8 ActionId , XPlmi_ErrorHandler_t ErrorHandler ) { int Status = XST_FAILURE ; u32 RegMask = XPlmi_ErrRegMask ( ErrorId ) ; switch ( ActionId ) { case XPLMI_EM_ACTION_NONE : ErrorTable [ ErrorId ] . Action = ActionId ; Status = XST_SUCCESS ; break ; case XPLMI_EM_ACTION_POR : ErrorTable [ ErrorId ] . Action = ActionId ; Status = XPlmi_EmEnablePOR ( NodeType , RegMask ) ; break ; case XPLMI_EM_ACTION_SRST : ErrorTable [ ErrorId ] . Action = ActionId ; Status = XPlmi_EmEnableSRST ( NodeType , RegMask ) ; break ; case XPLMI_EM_ACTION_CUSTOM : ErrorTable [ ErrorId ] . Action = ActionId ; ErrorTable [ ErrorId ] . Handler = ErrorHandler ; Status = XPlmi_EmEnableInt ( NodeType , RegMask ) ; break ; case XPLMI_EM_ACTION_ERROUT : ErrorTable [ ErrorId ] . Action = ActionId ; Status = XPlmi_EmEnablePSError ( NodeType , RegMask ) ; break ; case XPLMI_EM_ACTION_SUBSYS_SHUTDN : case XPLMI_EM_ACTION_SUBSYS_RESTART : ErrorTable [ ErrorId ] . Action = ActionId ; ErrorTable [ ErrorId ] . Handler = XPlmi_ErrIntrSubTypeHandler ; ErrorTable [ ErrorId ] . SubsystemId = EmSubsystemId ; Status = XPlmi_EmEnableInt ( NodeType , RegMask ) ; break ; default : Status = XPLMI_INVALID_ERROR_ACTION ; XPlmi_Printf ( DEBUG_GENERAL , " \n \r " , ErrorId ) ; break ; } return Status ; }
@brief       This function configures the Action specified for a given Error ID.
@brief This function configures the Action specified for a given Error ID .
/* Set error action for given error Id */ /* No Action */ /* Set the error action and enable it */ /* Set error action SRST for the errorId */ /* Set custom handler as error action for the errorId */ /* Set error action ERROUT signal for the errorId */ /* Set handler and error action for the errorId */ /* Invalid Action Id */