mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-24 01:37:22 +08:00
score: Add debug support to chains
This helps to detect * double insert, append, prepend errors, and * get from empty chain errors.
This commit is contained in:
@@ -187,6 +187,21 @@ RTEMS_INLINE_ROUTINE void rtems_chain_set_off_chain(
|
||||
_Chain_Set_off_chain( node );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes a chain node.
|
||||
*
|
||||
* In debug configurations, the node is set off chain. In all other
|
||||
* configurations, this function does nothing.
|
||||
*
|
||||
* @param[in] the_node The chain node to initialize.
|
||||
*/
|
||||
RTEMS_INLINE_ROUTINE void rtems_chain_initialize_node(
|
||||
rtems_chain_node *node
|
||||
)
|
||||
{
|
||||
_Chain_Initialize_node( node );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Is the node off chain.
|
||||
*
|
||||
|
||||
@@ -210,6 +210,7 @@ static inline void rtems_rbheap_add_to_spare_descriptor_chain(
|
||||
rtems_chain_control *chain =
|
||||
rtems_rbheap_get_spare_descriptor_chain(control);
|
||||
|
||||
rtems_chain_initialize_node(&chunk->chain_node);
|
||||
rtems_chain_prepend_unprotected(chain, &chunk->chain_node);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ static void add_to_chain(
|
||||
rtems_rbheap_chunk *chunk
|
||||
)
|
||||
{
|
||||
rtems_chain_initialize_node(&chunk->chain_node);
|
||||
rtems_chain_prepend_unprotected(chain, &chunk->chain_node);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user