?? ixqmgr.h
字號:
* * @ingroup IxQMgrAPI * * @fn ixQMgrQNumEntriesGet (IxQMgrQId qId, unsigned *numEntries) * * @brief Get a snapshot of the number of entries in a queue. * * This function gets the number of entries in a queue. * * @param qId @ref IxQMgrQId [in] qId - the queue idenfifier * @param *numEntries unsigned [out] - the number of entries in a queue * * @return @li IX_SUCCESS, got the number of entries for the queue * @return @li IX_QMGR_PARAMETER_ERROR, invalid paramter(s). * @return @li IX_QMGR_Q_NOT_CONFIGURED, the specified qId has not been configured * @return @li IX_QMGR_WARNING, could not determine num entries at this time * */PUBLIC IX_STATUSixQMgrQNumEntriesGet (IxQMgrQId qId, unsigned *numEntries);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrQStatusGetWithChecks (IxQMgrQId qId, IxQMgrQStatus *qStatus) * * @brief Get a queues status. * * This function reads the specified queues status. A queues status is defined * by its status flags. For queues 0-31 these flags are E,NE,NF,F. For * queues 32-63 these flags are NE and F. * * @param qId @ref IxQMgrQId [in] - the queue identifier. * @param &qStatus @ref IxQMgrQStatus [out] - the status of the specified queue. * * @return @li IX_SUCCESS, queue status was successfully read. * @return @li IX_QMGR_Q_NOT_CONFIGURED, the specified qId has not been configured * @return @li IX_QMGR_PARAMETER_ERROR, invalid paramter. * */PUBLIC IX_STATUSixQMgrQStatusGetWithChecks (IxQMgrQId qId, IxQMgrQStatus *qStatus);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrQStatusGet (IxQMgrQId qId, IxQMgrQStatus *qStatus) * * @brief Fast get of a queue's status. * * This function is a streamlined version of ixQMgrQStatusGetWithChecks(), but * performs essentially the same task. It reads the specified queue's status. * A queues status is defined by its status flags. For queues 0-31 these flags * are E,NE,NF,F. For queues 32-63 these flags are NE and F. * * @note - This function is inlined, to reduce unnecessary function call * overhead. It does not perform any parameter checks, or update any * statistics. Also, it does not check that the queue specified by qId has * been configured. It simply reads the specified queue's status. * * @param qId @ref IxQMgrQId [in] - the queue identifier. * @param *qStatus @ref IxQMgrQStatus [out] - the status of the specified queue. * * @return @li void. * */#ifdef NO_INLINE_APISPUBLIC IX_STATUSixQMgrQStatusGet (IxQMgrQId qId, IxQMgrQStatus *qStatus);#else extern UINT32 ixQMgrAqmIfQueLowStatRegAddr[];extern UINT32 ixQMgrAqmIfQueLowStatBitsOffset[];extern UINT32 ixQMgrAqmIfQueLowStatBitsMask;extern UINT32 ixQMgrAqmIfQueUppStat0RegAddr;extern UINT32 ixQMgrAqmIfQueUppStat1RegAddr;extern UINT32 ixQMgrAqmIfQueUppStat0BitMask[];extern UINT32 ixQMgrAqmIfQueUppStat1BitMask[];IX_QMGR_INLINE PUBLIC IX_STATUSixQMgrQStatusGet (IxQMgrQId qId, IxQMgrQStatus *qStatus);#endif /* endif NO_INLINE_APIS */IX_QMGR_INLINE PUBLIC IX_STATUSixQMgrQStatusGet (IxQMgrQId qId, IxQMgrQStatus *qStatus)#ifdef NO_INLINE_APIS ;#else{ /* read the status of a queue in the range 0-31 */ if (qId < IX_QMGR_MIN_QUEUPP_QID) { volatile UINT32 *lowStatRegAddr = (UINT32*)ixQMgrAqmIfQueLowStatRegAddr[qId]; UINT32 lowStatBitsOffset = ixQMgrAqmIfQueLowStatBitsOffset[qId]; UINT32 lowStatBitsMask = ixQMgrAqmIfQueLowStatBitsMask; /* read the status register for this queue */ *qStatus = IX_QMGR_INLINE_READ_LONG(lowStatRegAddr); /* mask out the status bits relevant only to this queue */ *qStatus = (*qStatus >> lowStatBitsOffset) & lowStatBitsMask; } else /* read status of a queue in the range 32-63 */ { volatile UINT32 *qNearEmptyStatRegAddr = (UINT32*)ixQMgrAqmIfQueUppStat0RegAddr; volatile UINT32 *qFullStatRegAddr = (UINT32*)ixQMgrAqmIfQueUppStat1RegAddr; int maskIndex = qId - IX_QMGR_MIN_QUEUPP_QID; UINT32 qNearEmptyStatBitMask = ixQMgrAqmIfQueUppStat0BitMask[maskIndex]; UINT32 qFullStatBitMask = ixQMgrAqmIfQueUppStat1BitMask[maskIndex]; /* Reset the status bits */ *qStatus = 0; /* Check if the queue is nearly empty */ if (IX_QMGR_INLINE_READ_LONG(qNearEmptyStatRegAddr) & qNearEmptyStatBitMask) { *qStatus |= IX_QMGR_Q_STATUS_NE_BIT_MASK; } /* Check if the queue is full */ if (IX_QMGR_INLINE_READ_LONG(qFullStatRegAddr) & qFullStatBitMask) { *qStatus |= IX_QMGR_Q_STATUS_F_BIT_MASK; } } return IX_SUCCESS;}#endif/* ------------------------------------------------------------ Queue dispatch related functions ---------------------------------------------------------- *//** * * @ingroup IxQMgrAPI * * @fn ixQMgrDispatcherPrioritySet (IxQMgrQId qId, IxQMgrPriority priority) * * @brief Set the dispatch priority of a queue. * * This function is called to set the dispatch priority of queue. The effect of * this function is to add a priority change request to a queue. This queue is * serviced by @a ixQMgrDispatcherLoopRunA0, @a ixQMgrDispatcherLoopRunB0 or * @a ixQMgrDispatcherLoopRunB0LLP. * * This function is re-entrant. and can be used from an interrupt context * * @param qId @ref IxQMgrQId [in] - the queue identifier * @param priority @ref IxQMgrPriority [in] - the new queue dispatch priority * * @return @li IX_SUCCESS, priority change request is queued * @return @li IX_QMGR_Q_NOT_CONFIGURED, the specified qId has not been configured * @return @li IX_QMGR_Q_INVALID_PRIORITY, specified priority is invalid * */PUBLIC IX_STATUSixQMgrDispatcherPrioritySet (IxQMgrQId qId, IxQMgrPriority priority);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrNotificationEnable (IxQMgrQId qId, IxQMgrSourceId sourceId) * * @brief Enable notification on a queue for a specified queue source flag. * * This function is called by a client of the QMgr to enable notifications on a * specified condition. * If the condition for the notification is set after the client has called this * function but before the function has enabled the interrupt source, then the * notification will not occur. * For queues 32-63 the notification source is fixed to the NE(Nearly Empty) flag * and cannot be changed so the sourceId parameter is ignored for these queues. * The status register is read before the notofication is enabled and is read again * after the notification has been enabled, if they differ then the warning status * is returned. * * This function is re-entrant. and can be used from an interrupt context * * @param qId @ref IxQMgrQId [in] - the queue identifier * @param sourceId @ref IxQMgrSourceId [in] - the interrupt src condition identifier * * @return @li IX_SUCCESS, the interrupt has been enabled for the specified source * @return @li IX_QMGR_Q_NOT_CONFIGURED, the specified qId has not been configured * @return @li IX_QMGR_INVALID_INT_SOURCE_ID, interrupt source invalid for this queue * @return @li IX_QMGR_WARNING, the status register may not be constistent * */PUBLIC IX_STATUSixQMgrNotificationEnable (IxQMgrQId qId, IxQMgrSourceId sourceId);/** * @ingroup IxQMgrAPI * * @fn ixQMgrNotificationDisable (IxQMgrQId qId) * * @brief Disable notifications on a queue. * * This function is called to disable notifications on a specified queue. * * This function is re-entrant. and can be used from an interrupt context * * @param qId @ref IxQMgrQId [in] - the queue identifier * * @return @li IX_SUCCESS, the interrupt has been disabled * @return @li IX_QMGR_Q_NOT_CONFIGURED, the specified qId has not been configured * */PUBLIC IX_STATUSixQMgrNotificationDisable (IxQMgrQId qId);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrDispatcherLoopRunA0 (IxQMgrDispatchGroup group) * * @brief Run the callback dispatcher. * * This function runs the dispatcher for a group of queues. * Callbacks are made for interrupts that have occurred on queues within * the group that have registered callbacks. The order in which queues are * serviced depends on the queue priorities set by the client. * This function may be called from interrupt or task context. * For optimisations that were introduced in IXP42X B0 and supported IXP46X * the @a ixQMgrDispatcherLoopRunB0, or @a ixQMgrDispatcherLoopRunB0LLP * should be used. * * This function is not re-entrant. * * @param group @ref IxQMgrDispatchGroup [in] - the group of queues over which the * dispatcher will run * * @return @li void * * @note This function may be called from interrupt or task context. * However, for optimal performance the choice of context depends also on the * operating system used. * */PUBLIC voidixQMgrDispatcherLoopRunA0 (IxQMgrDispatchGroup group);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrDispatcherLoopRunB0 (IxQMgrDispatchGroup group) * * @brief Run the callback dispatcher. * * The enhanced version of @a ixQMgrDispatcherLoopRunA0 that is optimised for * features introduced in IXP42X B0 silicon and supported on IXP46X. * This is the default dispatcher for IXP42X B0 and IXP46X silicon. * The function runs the dispatcher for a group of queues. * Callbacks are made for interrupts that have occurred on queues within * the group that have registered callbacks. The order in which queues are * serviced depends on the queue priorities set by the client. * This function may be called from interrupt or task context. * * This function is not re-entrant. * * @param group @ref IxQMgrDispatchGroup [in] - the group of queues over which the * dispatcher will run * * @return @li void * * * @note This function may be called from interrupt or task context. * However, for optimal performance the choice of context depends also on the * operating system used. * */PUBLIC voidixQMgrDispatcherLoopRunB0 (IxQMgrDispatchGroup group);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrDispatcherLoopRunB0LLP (IxQMgrDispatchGroup group) * * @brief Run the callback dispatcher. * * This is a version of the optimised dispatcher for IXP42X B0 and IXP46X, * @a ixQMgrDispatcherLoopRunB0, with added support for livelock prevention. * This dispatcher will only be used for the IXP42X B0 or IXP46X silicon if * feature control indicates that IX_FEATURECTRL_ORIGB0_DISPATCHER is set to * IX_FEATURE_CTRL_SWCONFIG_DISABLED. Otherwise the @a ixQMgrDispatcherLoopRunB0 * dispatcher will be used (Default). * * When this dispatcher notifies for a queue that is type * IX_QMGR_TYPE_REALTIME_PERIODIC, notifications for queues that are set * as type IX_QMGR_REALTIME_SPORADIC are not processed and disabled. * This helps prevent any tasks resulting from the notification of the * IX_QMGR_TYPE_REALTIME_PERIODIC type queue to being subject to livelock. * The function runs the dispatcher for a group of queues. * Callbacks are made for interrupts that have occurred on queues within * the group that have registered callbacks. The order in which queues are * serviced depends on their type along with the queue priorities set by the * client. This function may be called from interrupt or task context. * * This function is not re-entrant. * * @param group @ref IxQMgrDispatchGroup [in] - the group of queues over which * the dispatcher will run * * @return @li void * * @note This function may be called from interrupt or task context. * However, for optimal performance the choice of context depends also on the * operating system used. * */PUBLIC voidixQMgrDispatcherLoopRunB0LLP (IxQMgrDispatchGroup group);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrNotificationCallbackSet (IxQMgrQId qId, IxQMgrCallback callback, IxQMgrCallbackId callbackId) * * @brief Set the notification callback for a queue. * * This function sets the callback for the specified queue. This callback will * be called by the dispatcher, and may be called in the context of a interrupt * If callback has a value of NULL the previously registered callback, if one * exists will be unregistered. * * @param qId @ref IxQMgrQId [in] - the queue idenfifier * @param callback @ref IxQMgrCallback [in] - the callback registered for this queue * @param callbackId @ref IxQMgrCallbackId [in] - the callback identifier * * @return @li IX_SUCCESS, the callback for the specified queue has been set * @return @li IX_QMGR_Q_NOT_CONFIGURED, the specified qId has not been configured * */PUBLIC IX_STATUSixQMgrNotificationCallbackSet (IxQMgrQId qId, IxQMgrCallback callback, IxQMgrCallbackId callbackId);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrDispatcherLoopGet (IxQMgrDispatcherFuncPtr *qDispatcherFuncPtr) * * @brief Get QMgr DispatcherLoopRun for respective silicon device * * This function gets a function pointer to ixQMgrDispatcherLoopRunA0() for IXP42X A0 * Silicon. If the IXP42X B0 or 46X Silicon, the default is the ixQMgrDispatcherLoopRunB0() * function, however if live lock prevention is enabled a function pointer to * ixQMgrDispatcherLoopRunB0LLP() is given. * * @param *qDispatchFuncPtr @ref IxQMgrDispatcherFuncPtr [out] - * the function pointer of QMgr Dispatcher * */PUBLIC voidixQMgrDispatcherLoopGet (IxQMgrDispatcherFuncPtr *qDispatcherFuncPtr);/** * * @ingroup IxQMgrAPI * * @fn ixQMgrStickyInterruptRegEnable(void) * * @brief Enable AQM's sticky interrupt register behaviour only available * on B0 Silicon. * * When AQM's sticky interrupt register is enabled, interrupt register bit will * only be cleared when a '1' is written to interrupt register bit and the * interrupting condition is satisfied, i.e.queue condition does not exist. * * @note This function must be called before any queue is enabled. * Calling this function after queue is enabled will cause * undefined results. * * @return none * */PUBLIC voidixQMgrStickyInterruptRegEnable(void);/** * @ingroup IxQMgrAPI * * @fn ixQMgrCallbackTypeSet(IxQMgrQId qId, IxQMgrType type) * * @brief Set the Callback Type of a queue. * * This function is only used for live lock prevention. * This function allows the callback type of a queue to be set. The default for * all queues is IX_QMGR_TYPE_REALTIME_OTHER. Setting the type to * IX_QMGR_TYPE_REALTIME_SPORADIC means that this queue will have it's * notifications disabled while there is a task associated with a * queue of type IX_QMGR_TYPE_REALTIME_PERIODIC running. As live lock * prevention operates on lower queues, this function should * be called for lower queues only. * This function is not re-entrant. * * @param q
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -