forked from Imagelibrary/rtems
bsp/shared: Add bsp_interrupt_handler_is_empty.
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
* Germany
|
* Germany
|
||||||
* <rtems@embedded-brains.de>
|
* <rtems@embedded-brains.de>
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2016 Chris Johns <chrisj@rtems.org>
|
||||||
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
||||||
* http://www.rtems.org/license/LICENSE.
|
* http://www.rtems.org/license/LICENSE.
|
||||||
@@ -106,7 +108,7 @@ static inline rtems_vector_number bsp_interrupt_handler_index(
|
|||||||
* @defgroup bsp_interrupt BSP Interrupt Support
|
* @defgroup bsp_interrupt BSP Interrupt Support
|
||||||
*
|
*
|
||||||
* @ingroup bsp_shared
|
* @ingroup bsp_shared
|
||||||
*
|
*
|
||||||
* @brief Generic BSP Interrupt Support
|
* @brief Generic BSP Interrupt Support
|
||||||
*
|
*
|
||||||
* The BSP interrupt support manages a sequence of interrupt vector numbers
|
* The BSP interrupt support manages a sequence of interrupt vector numbers
|
||||||
@@ -272,6 +274,17 @@ static inline void bsp_interrupt_handler_dispatch(rtems_vector_number vector)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Is interrupt handler empty.
|
||||||
|
*
|
||||||
|
* This routine returns true if the handler is empty and has not been
|
||||||
|
* initialised else false is returned. The interrupt lock is not used
|
||||||
|
* so this call can be used from within interrupts.
|
||||||
|
*
|
||||||
|
* @return If empty true shall be returned else false is returned.
|
||||||
|
*/
|
||||||
|
bool bsp_interrupt_handler_is_empty(rtems_vector_number vector);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/* For internal use only */
|
/* For internal use only */
|
||||||
|
|||||||
@@ -566,3 +566,22 @@ rtems_status_code rtems_interrupt_handler_iterate(
|
|||||||
{
|
{
|
||||||
return bsp_interrupt_handler_iterate(vector, routine, arg);
|
return bsp_interrupt_handler_iterate(vector, routine, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bsp_interrupt_handler_is_empty(rtems_vector_number vector)
|
||||||
|
{
|
||||||
|
rtems_vector_number index = 0;
|
||||||
|
bsp_interrupt_handler_entry *head = NULL;
|
||||||
|
bool empty;
|
||||||
|
|
||||||
|
/* For use in interrupts so no lock. */
|
||||||
|
|
||||||
|
/* Get handler table index */
|
||||||
|
index = bsp_interrupt_handler_index(vector);
|
||||||
|
|
||||||
|
/* Get head entry of the handler list for the vector */
|
||||||
|
head = &bsp_interrupt_handler_table [index];
|
||||||
|
|
||||||
|
empty = bsp_interrupt_is_empty_handler_entry(head);
|
||||||
|
|
||||||
|
return empty;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user