mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2025-04-21 12:27:27 +03:00
m1/patches/rtems/: pending RTEMS patches (relative to latest CVS)
This commit is contained in:
44
m1/patches/rtems/chain-first-last.patch
Normal file
44
m1/patches/rtems/chain-first-last.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
This issue is under consideration:
|
||||
http://www.rtems.org/pipermail/rtems-users/2011-November/009130.html
|
||||
|
||||
Doubly-linked lists ("chains") in RTEMS have a "control" block that
|
||||
looks like the next/prev link pair in an element. The list elements
|
||||
link both ways to this control block.
|
||||
|
||||
_Chain_Is_first and _Chain_Is_last only probed if the link to the
|
||||
next element - which would be the control block - is non-NULL.
|
||||
Telling by the function description and given that there are already
|
||||
functions called _Chain_Is_head and _Chain_Is_tail (which could be
|
||||
simplified), this is probably not the intended behaviour.
|
||||
|
||||
This also affects the aliases rtems_chain_is_first and
|
||||
rtems_chain_is_last.
|
||||
|
||||
These functions are not used a lot and I haven't seen any immediate
|
||||
effect on M1 after changing them, so I can't say whether this patch
|
||||
may unearth other problems.
|
||||
|
||||
- Werner
|
||||
|
||||
Index: rtems/cpukit/score/inline/rtems/score/chain.inl
|
||||
===================================================================
|
||||
--- rtems.orig/cpukit/score/inline/rtems/score/chain.inl 2011-11-12 09:12:46.000000000 -0300
|
||||
+++ rtems/cpukit/score/inline/rtems/score/chain.inl 2011-11-12 09:13:47.000000000 -0300
|
||||
@@ -297,7 +297,7 @@
|
||||
const Chain_Node *the_node
|
||||
)
|
||||
{
|
||||
- return (the_node->previous == NULL);
|
||||
+ return the_node->previous->previous == NULL;
|
||||
}
|
||||
|
||||
/** @brief Is this the Last Node on the Chain
|
||||
@@ -314,7 +314,7 @@
|
||||
const Chain_Node *the_node
|
||||
)
|
||||
{
|
||||
- return (the_node->next == NULL);
|
||||
+ return the_node->next->next == NULL;
|
||||
}
|
||||
|
||||
/** @brief Does this Chain have only One Node
|
||||
Reference in New Issue
Block a user