diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-27 08:35:22 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-23 11:00:28 +0100 |
commit | 6d20f0c5257164d8ec8127e3e55a1686b7dba8d1 (patch) | |
tree | f6dc441d25e8f9141adc0b2cfc8ff05eda0d40a7 /cpukit/include/rtems/score/chainimpl.h | |
parent | score: Rework idle handling in SMP schedulers (diff) | |
download | rtems-6d20f0c5257164d8ec8127e3e55a1686b7dba8d1.tar.bz2 |
score: Add node to insert to Chain_Node_order
This allows to use additional members of the nodes for comparision.
Update #4534.
Diffstat (limited to 'cpukit/include/rtems/score/chainimpl.h')
-rw-r--r-- | cpukit/include/rtems/score/chainimpl.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpukit/include/rtems/score/chainimpl.h b/cpukit/include/rtems/score/chainimpl.h index 234dd1d74e..6aaa89237d 100644 --- a/cpukit/include/rtems/score/chainimpl.h +++ b/cpukit/include/rtems/score/chainimpl.h @@ -826,7 +826,8 @@ RTEMS_INLINE_ROUTINE bool _Chain_Get_with_empty_check_unprotected( * @retval false Otherwise. */ typedef bool ( *Chain_Node_order )( - const void *left, + const void *key, + const Chain_Node *left, const Chain_Node *right ); @@ -848,18 +849,20 @@ typedef bool ( *Chain_Node_order )( RTEMS_INLINE_ROUTINE void _Chain_Insert_ordered_unprotected( Chain_Control *the_chain, Chain_Node *to_insert, - const void *left, + const void *key, Chain_Node_order order ) { const Chain_Node *tail = _Chain_Immutable_tail( the_chain ); + Chain_Node *previous = _Chain_Head( the_chain ); Chain_Node *next = _Chain_First( the_chain ); - while ( next != tail && !( *order )( left, next ) ) { + while ( next != tail && !( *order )( key, to_insert, next ) ) { + previous = next; next = _Chain_Next( next ); } - _Chain_Insert_unprotected( _Chain_Previous( next ), to_insert ); + _Chain_Insert_unprotected( previous, to_insert ); } /** |