diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-11-25 09:27:06 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-11-25 09:27:06 +0000 |
commit | ce002b161d89c912c7f22da4dba86955251c3afd (patch) | |
tree | 947eb3c9a147e82733232d2c3f23ad21650aee58 /cpukit/score/src/chain.c | |
parent | 2010-11-24 Gedare Bloom <giddyup44@yahoo.com> (diff) | |
download | rtems-ce002b161d89c912c7f22da4dba86955251c3afd.tar.bz2 |
2010-11-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libfs/src/dosfs/fat_file.c, libfs/src/imfs/imfs_debug.c,
libfs/src/imfs/imfs_directory.c, libfs/src/imfs/imfs_getchild.c,
posix/src/killinfo.c, score/inline/rtems/score/schedulerpriority.inl,
score/inline/rtems/score/watchdog.inl, score/src/apiext.c,
score/src/chain.c, score/src/coremsgflushsupp.c,
score/src/coremsginsert.c, score/src/objectshrinkinformation.c,
score/src/schedulerpriorityyield.c,
score/src/threadqdequeuepriority.c,
score/src/threadqenqueuepriority.c,
score/src/threadqextractpriority.c, score/src/threadqfirstfifo.c,
score/src/threadqfirstpriority.c, score/src/threadyieldprocessor.c,
score/src/userextthreadbegin.c, score/src/userextthreadcreate.c,
score/src/userextthreaddelete.c, score/src/userextthreadrestart.c,
score/src/userextthreadstart.c, score/src/userextthreadswitch.c,
score/src/watchdogreportchain.c: Avoid chain API violations.
Diffstat (limited to 'cpukit/score/src/chain.c')
-rw-r--r-- | cpukit/score/src/chain.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/cpukit/score/src/chain.c b/cpukit/score/src/chain.c index c44d6201a3..85821d4d71 100644 --- a/cpukit/score/src/chain.c +++ b/cpukit/score/src/chain.c @@ -40,14 +40,14 @@ void _Chain_Initialize( size_t node_size ) { - size_t count; - Chain_Node *current; - Chain_Node *next; + size_t count = number_nodes; + Chain_Node *head = _Chain_Head( the_chain ); + Chain_Node *tail = _Chain_Tail( the_chain ); + Chain_Node *current = head; + Chain_Node *next = starting_address; + + head->previous = NULL; - count = number_nodes; - current = _Chain_Head( the_chain ); - the_chain->permanent_null = NULL; - next = starting_address; while ( count-- ) { current->next = next; next->previous = current; @@ -55,6 +55,7 @@ void _Chain_Initialize( next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } - current->next = _Chain_Tail( the_chain ); - the_chain->last = current; + + current->next = tail; + tail->previous = current; } |