Index: c/src/libchip/ide/ata.c =================================================================== RCS file: /usr1/CVS/rtems/c/src/libchip/ide/ata.c,v retrieving revision 1.12 diff -u -r1.12 ata.c --- c/src/libchip/ide/ata.c 9 Jul 2006 10:05:27 -0000 1.12 +++ c/src/libchip/ide/ata.c 22 Nov 2006 12:27:49 -0000 @@ -431,7 +431,7 @@ /* get first request in the controller's queue */ _ISR_Disable(level); - areq = (ata_req_t *)(ata_ide_ctrls[ctrl_minor].reqs.first); + areq = (ata_req_t *)_Chain_First(&(ata_ide_ctrls[ctrl_minor].reqs)); _ISR_Enable(level); /* get ATA device identifier (0 or 1) */ @@ -640,7 +640,7 @@ { int ata_irq_chain_index = (int) handle; Chain_Node *the_node = - ata_irq_chain[ata_irq_chain_index].irq_chain.last; + _Chain_Last(&(ata_irq_chain[ata_irq_chain_index].irq_chain)); ata_queue_msg_t msg; uint16_t byte; /* emphasize that only 8 low bits is meaningful */ @@ -839,7 +839,7 @@ /* get current request to the controller */ _ISR_Disable(level); - areq = (ata_req_t *)(ata_ide_ctrls[ctrl_minor].reqs.first); + areq = (ata_req_t *)_Chain_First(&(ata_ide_ctrls[ctrl_minor].reqs)); _ISR_Enable(level); switch(msg.type) Index: cpukit/itron/src/ref_mbf.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/itron/src/ref_mbf.c,v retrieving revision 1.6 diff -u -r1.6 ref_mbf.c --- cpukit/itron/src/ref_mbf.c 15 Apr 2004 04:00:25 -0000 1.6 +++ cpukit/itron/src/ref_mbf.c 22 Nov 2006 12:28:42 -0000 @@ -53,7 +53,7 @@ pk_rmbf->msgsz = 0; } else { pk_rmbf->msgsz = ((CORE_message_queue_Buffer_control *) - the_core_msgq->Pending_messages.first)->Contents.size; + _Chain_First(&(the_core_msgq->Pending_messages)))->Contents.size; } /* Index: cpukit/libcsupport/src/mount.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/mount.c,v retrieving revision 1.26 diff -u -r1.26 mount.c --- cpukit/libcsupport/src/mount.c 18 Apr 2004 06:05:34 -0000 1.26 +++ cpukit/libcsupport/src/mount.c 22 Nov 2006 12:28:49 -0000 @@ -280,7 +280,7 @@ * For each mount table entry */ - for ( the_node = rtems_filesystem_mount_table_control.first; + for ( the_node = _Chain_First(&(rtems_filesystem_mount_table_control)); !Chain_Is_tail( &rtems_filesystem_mount_table_control, the_node ); the_node = the_node->next ) { the_mount_entry = (rtems_filesystem_mount_table_entry_t *) the_node; Index: cpukit/libcsupport/src/privateenv.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/privateenv.c,v retrieving revision 1.9 diff -u -r1.9 privateenv.c --- cpukit/libcsupport/src/privateenv.c 18 Apr 2004 06:05:35 -0000 1.9 +++ cpukit/libcsupport/src/privateenv.c 22 Nov 2006 12:28:50 -0000 @@ -27,7 +27,7 @@ #define THE_ROOT_FS_LOC \ (((rtems_filesystem_mount_table_entry_t*)\ - rtems_filesystem_mount_table_control.first)->mt_fs_root) + _Chain_First(&rtems_filesystem_mount_table_control))->mt_fs_root) /* cleanup a user environment * NOTE: this must be called with Index: cpukit/libcsupport/src/unmount.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/libcsupport/src/unmount.c,v retrieving revision 1.20 diff -u -r1.20 unmount.c --- cpukit/libcsupport/src/unmount.c 18 Apr 2004 06:05:35 -0000 1.20 +++ cpukit/libcsupport/src/unmount.c 22 Nov 2006 12:28:51 -0000 @@ -77,7 +77,7 @@ * mount entry. */ - for ( the_node = rtems_filesystem_mount_table_control.first; + for ( the_node = _Chain_First(&(rtems_filesystem_mount_table_control)); !Chain_Is_tail( &rtems_filesystem_mount_table_control, the_node ); the_node = the_node->next ) { the_mount_entry = ( rtems_filesystem_mount_table_entry_t * )the_node; Index: cpukit/libfs/src/dosfs/fat_file.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/libfs/src/dosfs/fat_file.c,v retrieving revision 1.11 diff -u -r1.11 fat_file.c --- cpukit/libfs/src/dosfs/fat_file.c 6 May 2005 14:57:43 -0000 1.11 +++ cpukit/libfs/src/dosfs/fat_file.c 22 Nov 2006 12:28:52 -0000 @@ -917,7 +917,7 @@ ) { uint32_t mod = (key1) % FAT_HASH_MODULE; - Chain_Node *the_node = ((Chain_Control *)((hash) + mod))->first; + Chain_Node *the_node = _Chain_First((Chain_Control *)((hash) + mod)); for ( ; !_Chain_Is_tail((hash) + mod, the_node) ; ) { Index: cpukit/libfs/src/imfs/imfs_debug.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/libfs/src/imfs/imfs_debug.c,v retrieving revision 1.12 diff -u -r1.12 imfs_debug.c --- cpukit/libfs/src/imfs/imfs_debug.c 29 Aug 2006 19:38:08 -0000 1.12 +++ cpukit/libfs/src/imfs/imfs_debug.c 22 Nov 2006 12:28:56 -0000 @@ -132,7 +132,7 @@ the_chain = &the_directory->info.directory.Entries; - for ( the_node = the_chain->first; + for ( the_node = _Chain_First(the_chain); !_Chain_Is_tail( the_chain, the_node ); the_node = the_node->next ) { Index: cpukit/libfs/src/imfs/imfs_directory.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/libfs/src/imfs/imfs_directory.c,v retrieving revision 1.19 diff -u -r1.19 imfs_directory.c --- cpukit/libfs/src/imfs/imfs_directory.c 17 Apr 2004 08:34:41 -0000 1.19 +++ cpukit/libfs/src/imfs/imfs_directory.c 22 Nov 2006 12:28:56 -0000 @@ -98,7 +98,7 @@ return 0; /* Move to the first of the desired directory entries */ - the_node = the_chain->first; + the_node = _Chain_First(the_chain); bytes_transferred = 0; first_entry = iop->offset; @@ -264,7 +264,7 @@ /* Run through the chain and count the number of directory entries */ /* that are subordinate to this directory node */ - for ( the_node = the_chain->first ; + for ( the_node = _Chain_First(the_chain) ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { Index: cpukit/libfs/src/imfs/imfs_getchild.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/libfs/src/imfs/imfs_getchild.c,v retrieving revision 1.8 diff -u -r1.8 imfs_getchild.c --- cpukit/libfs/src/imfs/imfs_getchild.c 17 Apr 2004 08:34:41 -0000 1.8 +++ cpukit/libfs/src/imfs/imfs_getchild.c 22 Nov 2006 12:28:56 -0000 @@ -59,7 +59,7 @@ the_chain = &directory->info.directory.Entries; - for ( the_node = the_chain->first; + for ( the_node = _Chain_First(the_chain); !_Chain_Is_tail( the_chain, the_node ); the_node = the_node->next ) { Index: cpukit/posix/src/killinfo.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/posix/src/killinfo.c,v retrieving revision 1.12 diff -u -r1.12 killinfo.c --- cpukit/posix/src/killinfo.c 21 May 2004 20:19:33 -0000 1.12 +++ cpukit/posix/src/killinfo.c 22 Nov 2006 12:29:50 -0000 @@ -139,7 +139,7 @@ the_chain = &_POSIX_signals_Wait_queue.Queues.Priority[ index ]; - for ( the_node = the_chain->first ; + for ( the_node = _Chain_First(the_chain) ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { Index: cpukit/rtems/include/rtems/rtems/timer.h =================================================================== RCS file: /usr1/CVS/rtems/cpukit/rtems/include/rtems/rtems/timer.h,v retrieving revision 1.20 diff -u -r1.20 timer.h --- cpukit/rtems/include/rtems/rtems/timer.h 28 Jan 2005 05:00:20 -0000 1.20 +++ cpukit/rtems/include/rtems/rtems/timer.h 22 Nov 2006 12:30:04 -0000 @@ -345,7 +345,7 @@ do { \ if ( !_Chain_Is_empty( &_Timer_Ticks_chain ) ) { \ _Watchdog_Insert_ticks( &_Timer_Server->Timer, \ - ((Watchdog_Control *)_Timer_Ticks_chain.first)->delta_interval ); \ + ((Watchdog_Control *)_Chain_First(&(_Timer_Ticks_chain)))->delta_interval ); \ } \ } while (0) @@ -353,7 +353,7 @@ do { \ if ( !_Chain_Is_empty( &_Timer_Seconds_chain ) ) { \ _Watchdog_Insert_seconds( &_Timer_Seconds_timer, \ - ((Watchdog_Control *)_Timer_Seconds_chain.first)->delta_interval ); \ + ((Watchdog_Control *)_Chain_First(&(_Timer_Seconds_chain)))->delta_interval ); \ } \ } while (0) Index: cpukit/score/include/rtems/score/chain.h =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/include/rtems/score/chain.h,v retrieving revision 1.20 diff -u -r1.20 chain.h --- cpukit/score/include/rtems/score/chain.h 16 Jan 2006 15:13:58 -0000 1.20 +++ cpukit/score/include/rtems/score/chain.h 22 Nov 2006 12:30:28 -0000 @@ -13,7 +13,7 @@ * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * - * $Id: chain.h,v 1.20 2006/01/16 15:13:58 joel Exp $ + * $Id: chain.h,v 1.21 2006/10/19 19:20:09 joel Exp $ */ #ifndef _RTEMS_SCORE_CHAIN_H @@ -84,15 +84,40 @@ * @a permanent_null and @a last elements of the structure. * */ -typedef struct { - /** This points to the first node on this chain. */ - Chain_Node *first; - /** This field is always 0. */ - Chain_Node *permanent_null; - /** This points to the last node on this chain. */ - Chain_Node *last; +typedef union { + struct { + /** This is the head of the chain */ + Chain_Node head_node; + Chain_Node *dummy_head; + } head_of_chain; + struct { + Chain_Node *dummy_tail; + /** This is the tail of the chain */ + Chain_Node tail_node; + } tail_of_chain; } Chain_Control; +/** @brief Access pointer to first Chain Node + * + * This macro accesses the pointer to the first node liked to the chain. + * + * @param[in] the_chain is the chain to be operated upon. + * + * @return This method returns the first node of the chain. + */ +#define _Chain_First(the_chain) ((the_chain)->head_of_chain.head_node.next) + +/** @brief Access pointer to last Chain Node + * + * This macro accesses the pointer to the last node linked to the chain. + * + * @param[in] the_chain is the chain to be operated upon. + * + * @return This method returns the last node of the chain. + */ +#define _Chain_Last(the_chain) ((the_chain)->tail_of_chain.tail_node.previous) + + /** * @brief Initialize a Chain Header * @@ -113,21 +138,6 @@ uint32_t node_size ); -#ifndef RTEMS_INLINES -/** - * @brief Get the first node (do not disable interrupts) - * - * This method attempts to obtain the first node from @a the_chain. - * - * @param[in] the_chain points to the chain to operate upon - * @return If successful, a chain node is returned. Otherwise, NULL - * is returned. - */ -Chain_Node *_Chain_Get_first_unprotected( - Chain_Control *the_chain -); -#endif - /** * @brief Extract the specified node from a chain * Index: cpukit/score/inline/rtems/score/chain.inl =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/inline/rtems/score/chain.inl,v retrieving revision 1.14 diff -u -r1.14 chain.inl --- cpukit/score/inline/rtems/score/chain.inl 16 Jan 2006 15:13:58 -0000 1.14 +++ cpukit/score/inline/rtems/score/chain.inl 22 Nov 2006 12:30:31 -0000 @@ -89,7 +89,7 @@ Chain_Control *the_chain ) { - return (Chain_Node *) the_chain; + return &(the_chain->head_of_chain.head_node); } /** @brief Return pointer to Chain Tail @@ -104,7 +104,7 @@ Chain_Control *the_chain ) { - return (Chain_Node *) &the_chain->permanent_null; + return &(the_chain->tail_of_chain.tail_node); } /** @brief Is the Chain Empty @@ -121,7 +121,7 @@ Chain_Control *the_chain ) { - return (the_chain->first == _Chain_Tail(the_chain)); + return (the_chain->head_of_chain.head_node.next == _Chain_Tail(the_chain)); } /** @brief Is this the First Node on the Chain @@ -173,7 +173,8 @@ Chain_Control *the_chain ) { - return (the_chain->first == the_chain->last); + return (the_chain->head_of_chain.head_node.next == + the_chain->tail_of_chain.tail_node.previous); } /** @brief Is this Node the Chain Head @@ -221,9 +222,18 @@ Chain_Control *the_chain ) { - the_chain->first = _Chain_Tail(the_chain); - the_chain->permanent_null = NULL; - the_chain->last = _Chain_Head(the_chain); + the_chain->head_of_chain.head_node.next = + &(the_chain->tail_of_chain.tail_node); + + the_chain->head_of_chain.head_node.previous = NULL; + + /* XXX: the next statement is superfluous, because it + overlaps the previous NULL in the realy data structure */ + /* the_chain->tail_of_chain.tail_node.next = NULL; */ + + the_chain->tail_of_chain.tail_node.previous = + &(the_chain->head_of_chain.head_node); + } /** @brief Extract this Node (unprotected) @@ -268,10 +278,10 @@ Chain_Node *return_node; Chain_Node *new_first; - return_node = the_chain->first; - new_first = return_node->next; - the_chain->first = new_first; - new_first->previous = _Chain_Head(the_chain); + return_node = the_chain->head_of_chain.head_node.next; + new_first = return_node->next; + the_chain->head_of_chain.head_node.next = new_first; + new_first->previous = _Chain_Head(the_chain); return return_node; } @@ -342,11 +352,11 @@ { Chain_Node *old_last_node; - the_node->next = _Chain_Tail(the_chain); - old_last_node = the_chain->last; - the_chain->last = the_node; - old_last_node->next = the_node; - the_node->previous = old_last_node; + the_node->next = _Chain_Tail(the_chain); + old_last_node = the_chain->tail_of_chain.tail_node.previous ; + the_chain->tail_of_chain.tail_node.previous = the_node; + old_last_node->next = the_node; + the_node->previous = old_last_node; } /** @brief Prepend a Node (unprotected) Index: cpukit/score/inline/rtems/score/thread.inl =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/inline/rtems/score/thread.inl,v retrieving revision 1.25 diff -u -r1.25 thread.inl --- cpukit/score/inline/rtems/score/thread.inl 7 Mar 2006 20:47:53 -0000 1.25 +++ cpukit/score/inline/rtems/score/thread.inl 22 Nov 2006 12:30:32 -0000 @@ -105,7 +105,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) - _Thread_Ready_chain[ _Priority_Get_highest() ].first; + _Chain_First(&_Thread_Ready_chain[ _Priority_Get_highest() ]); } /** Index: cpukit/score/inline/rtems/score/watchdog.inl =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/inline/rtems/score/watchdog.inl,v retrieving revision 1.15 diff -u -r1.15 watchdog.inl --- cpukit/score/inline/rtems/score/watchdog.inl 21 Feb 2005 07:53:52 -0000 1.15 +++ cpukit/score/inline/rtems/score/watchdog.inl 22 Nov 2006 12:30:33 -0000 @@ -234,7 +234,7 @@ ) { - return ( (Watchdog_Control *) header->first ); + return ( (Watchdog_Control *) _Chain_First(header) ); } @@ -248,7 +248,7 @@ ) { - return ( (Watchdog_Control *) header->last ); + return ( (Watchdog_Control *) _Chain_Last(header) ); } Index: cpukit/score/src/apiext.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/apiext.c,v retrieving revision 1.11 diff -u -r1.11 apiext.c --- cpukit/score/src/apiext.c 27 Jan 2005 05:57:04 -0000 1.11 +++ cpukit/score/src/apiext.c 22 Nov 2006 12:30:34 -0000 @@ -51,7 +51,7 @@ Chain_Node *the_node; API_extensions_Control *the_extension; - for ( the_node = _API_extensions_List.first ; + for ( the_node = _Chain_First(&(_API_extensions_List)) ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { @@ -72,7 +72,7 @@ Chain_Node *the_node; API_extensions_Control *the_extension; - for ( the_node = _API_extensions_List.first ; + for ( the_node = _Chain_First(&(_API_extensions_List)) ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { @@ -93,7 +93,7 @@ Chain_Node *the_node; API_extensions_Control *the_extension; - for ( the_node = _API_extensions_List.first ; + for ( the_node = _Chain_First(&(_API_extensions_List)) ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { Index: cpukit/score/src/chain.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/chain.c,v retrieving revision 1.15 diff -u -r1.15 chain.c --- cpukit/score/src/chain.c 27 Jan 2005 05:57:04 -0000 1.15 +++ cpukit/score/src/chain.c 22 Nov 2006 12:30:34 -0000 @@ -13,7 +13,7 @@ * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * - * $Id: chain.c,v 1.15 2005/01/27 05:57:04 ralf Exp $ + * $Id: chain.c,v 1.16 2006/10/19 19:20:10 joel Exp $ */ #if HAVE_CONFIG_H @@ -51,10 +51,10 @@ Chain_Node *current; Chain_Node *next; - count = number_nodes; - current = _Chain_Head( the_chain ); - the_chain->permanent_null = NULL; - next = starting_address; + count = number_nodes; + current = _Chain_Head( the_chain ); + the_chain->head_of_chain.head_node.previous = NULL; + next = starting_address; while ( count-- ) { current->next = next; next->previous = current; @@ -62,34 +62,12 @@ next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } - current->next = _Chain_Tail( the_chain ); - the_chain->last = current; + current->next = _Chain_Tail( the_chain ); + the_chain->tail_of_chain.tail_node.previous = current; } /*PAGE * - * _Chain_Get_first_unprotected - */ - -#ifndef RTEMS_INLINES -Chain_Node *_Chain_Get_first_unprotected( - Chain_Control *the_chain -) -{ - Chain_Node *return_node; - Chain_Node *new_first; - - return_node = the_chain->first; - new_first = return_node->next; - the_chain->first = new_first; - new_first->previous = _Chain_Head( the_chain ); - - return return_node; -} -#endif /* RTEMS_INLINES */ - -/*PAGE - * * _Chain_Get * * This kernel routine returns a pointer to a node taken from the Index: cpukit/score/src/coremsgflushsupp.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/coremsgflushsupp.c,v retrieving revision 1.8 diff -u -r1.8 coremsgflushsupp.c --- cpukit/score/src/coremsgflushsupp.c 27 Jan 2005 05:57:04 -0000 1.8 +++ cpukit/score/src/coremsgflushsupp.c 22 Nov 2006 12:30:34 -0000 @@ -89,11 +89,12 @@ */ _ISR_Disable( level ); - inactive_first = the_message_queue->Inactive_messages.first; - message_queue_first = the_message_queue->Pending_messages.first; - message_queue_last = the_message_queue->Pending_messages.last; + inactive_first = _Chain_First(&(the_message_queue->Inactive_messages)); + message_queue_first = _Chain_First(&(the_message_queue->Pending_messages)); + message_queue_last = _Chain_Last(&(the_message_queue->Pending_messages)); - the_message_queue->Inactive_messages.first = message_queue_first; + _Chain_First(&(the_message_queue->Inactive_messages)) = + message_queue_first; message_queue_last->next = inactive_first; inactive_first->previous = message_queue_last; message_queue_first->previous = Index: cpukit/score/src/coremsginsert.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/coremsginsert.c,v retrieving revision 1.5 diff -u -r1.5 coremsginsert.c --- cpukit/score/src/coremsginsert.c 1 Sep 2005 16:32:06 -0000 1.5 +++ cpukit/score/src/coremsginsert.c 22 Nov 2006 12:30:34 -0000 @@ -85,7 +85,7 @@ Chain_Control *the_header; the_header = &the_message_queue->Pending_messages; - the_node = the_header->first; + the_node = _Chain_First(the_header); while ( !_Chain_Is_tail( the_header, the_node ) ) { this_message = (CORE_message_queue_Buffer_control *) the_node; Index: cpukit/score/src/objectshrinkinformation.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/objectshrinkinformation.c,v retrieving revision 1.6 diff -u -r1.6 objectshrinkinformation.c --- cpukit/score/src/objectshrinkinformation.c 27 Jan 2005 05:57:05 -0000 1.6 +++ cpukit/score/src/objectshrinkinformation.c 22 Nov 2006 12:30:36 -0000 @@ -69,7 +69,7 @@ * and remove elements. */ - the_object = (Objects_Control *) information->Inactive.first; + the_object = (Objects_Control *) _Chain_First(&(information->Inactive)); /* * Assume the Inactive chain is never empty at this point Index: cpukit/score/src/threadqdequeuepriority.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqdequeuepriority.c,v retrieving revision 1.6 diff -u -r1.6 threadqdequeuepriority.c --- cpukit/score/src/threadqdequeuepriority.c 27 Jan 2005 05:57:05 -0000 1.6 +++ cpukit/score/src/threadqdequeuepriority.c 22 Nov 2006 12:30:37 -0000 @@ -62,7 +62,7 @@ index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) { the_thread = (Thread_Control *) - the_thread_queue->Queues.Priority[ index ].first; + _Chain_First(&(the_thread_queue->Queues.Priority[ index ])); goto dequeue; } } @@ -81,13 +81,13 @@ } dequeue: - new_first_node = the_thread->Wait.Block2n.first; + new_first_node = _Chain_First(&(the_thread->Wait.Block2n)); new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; previous_node = the_thread->Object.Node.previous; if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { - last_node = the_thread->Wait.Block2n.last; + last_node = _Chain_Last(&(the_thread->Wait.Block2n)); new_second_node = new_first_node->next; previous_node->next = new_first_node; @@ -100,8 +100,8 @@ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); - new_first_thread->Wait.Block2n.first = new_second_node; - new_first_thread->Wait.Block2n.last = last_node; + _Chain_First(&(new_first_thread->Wait.Block2n)) = new_second_node; + _Chain_Last(&(new_first_thread->Wait.Block2n)) = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } Index: cpukit/score/src/threadqenqueuepriority.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqenqueuepriority.c,v retrieving revision 1.8 diff -u -r1.8 threadqenqueuepriority.c --- cpukit/score/src/threadqenqueuepriority.c 11 Jul 2006 21:05:12 -0000 1.8 +++ cpukit/score/src/threadqenqueuepriority.c 22 Nov 2006 12:30:37 -0000 @@ -73,7 +73,7 @@ restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); - search_thread = (Thread_Control *) header->first; + search_thread = (Thread_Control *) _Chain_First(header); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { search_priority = search_thread->current_priority; if ( priority <= search_priority ) @@ -119,7 +119,7 @@ search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); - search_thread = (Thread_Control *) header->last; + search_thread = (Thread_Control *) _Chain_Last(header); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { search_priority = search_thread->current_priority; if ( priority >= search_priority ) Index: cpukit/score/src/threadqextractpriority.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqextractpriority.c,v retrieving revision 1.5 diff -u -r1.5 threadqextractpriority.c --- cpukit/score/src/threadqextractpriority.c 27 Jan 2005 05:57:05 -0000 1.5 +++ cpukit/score/src/threadqextractpriority.c 22 Nov 2006 12:30:37 -0000 @@ -63,9 +63,9 @@ previous_node = the_node->previous; if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { - new_first_node = the_thread->Wait.Block2n.first; + new_first_node = _Chain_First(&(the_thread->Wait.Block2n)); new_first_thread = (Thread_Control *) new_first_node; - last_node = the_thread->Wait.Block2n.last; + last_node = _Chain_Last(&(the_thread->Wait.Block2n)); new_second_node = new_first_node->next; previous_node->next = new_first_node; @@ -77,9 +77,9 @@ /* > two threads on 2-n */ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); - new_first_thread->Wait.Block2n.first = new_second_node; + _Chain_First(&(new_first_thread->Wait.Block2n)) = new_second_node; - new_first_thread->Wait.Block2n.last = last_node; + _Chain_Last(&(new_first_thread->Wait.Block2n)) = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { Index: cpukit/score/src/threadqfirstfifo.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqfirstfifo.c,v retrieving revision 1.5 diff -u -r1.5 threadqfirstfifo.c --- cpukit/score/src/threadqfirstfifo.c 27 Jan 2005 05:57:05 -0000 1.5 +++ cpukit/score/src/threadqfirstfifo.c 22 Nov 2006 12:30:37 -0000 @@ -44,7 +44,7 @@ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) - return (Thread_Control *) the_thread_queue->Queues.Fifo.first; + return (Thread_Control *) _Chain_First(&(the_thread_queue->Queues.Fifo)); return NULL; } Index: cpukit/score/src/threadqfirstpriority.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadqfirstpriority.c,v retrieving revision 1.5 diff -u -r1.5 threadqfirstpriority.c --- cpukit/score/src/threadqfirstpriority.c 27 Jan 2005 05:57:05 -0000 1.5 +++ cpukit/score/src/threadqfirstpriority.c 22 Nov 2006 12:30:38 -0000 @@ -50,7 +50,7 @@ index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) return (Thread_Control *) - the_thread_queue->Queues.Priority[ index ].first; + _Chain_First(&(the_thread_queue->Queues.Priority[ index ])); } return NULL; } Index: cpukit/score/src/threadresettimeslice.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadresettimeslice.c,v retrieving revision 1.4 diff -u -r1.4 threadresettimeslice.c --- cpukit/score/src/threadresettimeslice.c 27 Jan 2005 05:57:05 -0000 1.4 +++ cpukit/score/src/threadresettimeslice.c 22 Nov 2006 12:30:38 -0000 @@ -67,7 +67,7 @@ _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) - _Thread_Heir = (Thread_Control *) ready->first; + _Thread_Heir = (Thread_Control *) _Chain_First(ready); _Context_Switch_necessary = TRUE; Index: cpukit/score/src/threadrotatequeue.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadrotatequeue.c,v retrieving revision 1.6 diff -u -r1.6 threadrotatequeue.c --- cpukit/score/src/threadrotatequeue.c 27 Jan 2005 05:57:05 -0000 1.6 +++ cpukit/score/src/threadrotatequeue.c 22 Nov 2006 12:30:38 -0000 @@ -81,7 +81,7 @@ _ISR_Flash( level ); if ( _Thread_Heir->ready == ready ) - _Thread_Heir = (Thread_Control *) ready->first; + _Thread_Heir = (Thread_Control *) _Chain_First(ready); if ( executing != _Thread_Heir ) _Context_Switch_necessary = TRUE; Index: cpukit/score/src/threadyieldprocessor.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/threadyieldprocessor.c,v retrieving revision 1.4 diff -u -r1.4 threadyieldprocessor.c --- cpukit/score/src/threadyieldprocessor.c 27 Jan 2005 05:57:05 -0000 1.4 +++ cpukit/score/src/threadyieldprocessor.c 22 Nov 2006 12:30:38 -0000 @@ -66,7 +66,7 @@ _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) - _Thread_Heir = (Thread_Control *) ready->first; + _Thread_Heir = (Thread_Control *) _Chain_First(ready); _Context_Switch_necessary = TRUE; } else if ( !_Thread_Is_heir( executing ) ) Index: cpukit/score/src/userext.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/userext.c,v retrieving revision 1.13 diff -u -r1.13 userext.c --- cpukit/score/src/userext.c 27 Jan 2005 05:57:05 -0000 1.13 +++ cpukit/score/src/userext.c 22 Nov 2006 12:30:38 -0000 @@ -33,7 +33,7 @@ User_extensions_Control *the_extension; boolean status; - for ( the_node = _User_extensions_List.first ; + for ( the_node = _Chain_First(&(_User_extensions_List)) ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { @@ -64,7 +64,7 @@ Chain_Node *the_node; User_extensions_Control *the_extension; - for ( the_node = _User_extensions_List.last ; + for ( the_node = _Chain_Last(&(_User_extensions_List)) ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { @@ -91,7 +91,7 @@ Chain_Node *the_node; User_extensions_Control *the_extension; - for ( the_node = _User_extensions_List.first ; + for ( the_node = _Chain_First(&(_User_extensions_List)) ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { @@ -118,7 +118,7 @@ Chain_Node *the_node; User_extensions_Control *the_extension; - for ( the_node = _User_extensions_List.first ; + for ( the_node = _Chain_First(&(_User_extensions_List)) ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { @@ -145,7 +145,7 @@ Chain_Node *the_node; User_extensions_Control *the_extension; - for ( the_node = _User_extensions_List.first ; + for ( the_node = _Chain_First(&(_User_extensions_List)) ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { @@ -168,7 +168,7 @@ Chain_Node *the_node; User_extensions_Control *the_extension; - for ( the_node = _User_extensions_List.last ; + for ( the_node = _Chain_Last(&(_User_extensions_List)) ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { @@ -193,7 +193,7 @@ Chain_Node *the_node; User_extensions_Control *the_extension; - for ( the_node = _User_extensions_List.last ; + for ( the_node = _Chain_Last(&(_User_extensions_List)) ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { Index: cpukit/score/src/watchdoginsert.c =================================================================== RCS file: /usr1/CVS/rtems/cpukit/score/src/watchdoginsert.c,v retrieving revision 1.10 diff -u -r1.10 watchdoginsert.c --- cpukit/score/src/watchdoginsert.c 17 Aug 2005 22:49:56 -0000 1.10 +++ cpukit/score/src/watchdoginsert.c 22 Nov 2006 12:30:38 -0000 @@ -73,7 +73,7 @@ * Till Straumann, 7/2003 (gcc-3.2.2 -O4 on powerpc) * */ - for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; + for ( after = (Watchdog_Control *) _Chain_First((volatile Chain_Control *)header) ; ; after = _Watchdog_Next( after ) ) { Index: make/custom/mbx8xx.cfg =================================================================== RCS file: /usr1/CVS/rtems/make/custom/mbx8xx.cfg,v retrieving revision 1.17 diff -u -r1.17 mbx8xx.cfg --- make/custom/mbx8xx.cfg 2 Aug 2002 00:08:01 -0000 1.17 +++ make/custom/mbx8xx.cfg 22 Nov 2006 12:32:10 -0000 @@ -43,7 +43,7 @@ # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. # -CPU_CFLAGS = -mcpu=$(8XX_CPU_TYPE) -Dmpc$(8XX_CPU_TYPE) -D$(RTEMS_MBX_MODEL) +CPU_CFLAGS = -g -mcpu=$(8XX_CPU_TYPE) -Dmpc$(8XX_CPU_TYPE) -D$(RTEMS_MBX_MODEL) CFLAGS_DEBUG_V += -ggdb CXXFLAGS_DEBUG_V += -ggdb Index: testsuites/tmtests/tm26/task1.c =================================================================== RCS file: /usr1/CVS/rtems/testsuites/tmtests/tm26/task1.c,v retrieving revision 1.23 diff -u -r1.23 task1.c --- testsuites/tmtests/tm26/task1.c 20 Apr 2004 07:03:41 -0000 1.23 +++ testsuites/tmtests/tm26/task1.c 22 Nov 2006 12:32:46 -0000 @@ -235,7 +235,7 @@ Middle_tcb = _Thread_Executing; _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[200].first; + (Thread_Control *) _Chain_First(&(_Thread_Ready_chain[200])); /* do not force context switch */ @@ -272,7 +272,7 @@ context_switch_another_task_time = Read_timer(); _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[201].first; + (Thread_Control *) _Chain_First(&(_Thread_Ready_chain[201])); /* do not force context switch */ @@ -299,7 +299,7 @@ executing = _Thread_Executing; _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[202].first; + (Thread_Control *) _Chain_First(&(_Thread_Ready_chain[202])); /* do not force context switch */ @@ -322,7 +322,7 @@ executing = _Thread_Executing; _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[202].first; + (Thread_Control *) _Chain_First(&(_Thread_Ready_chain[202])); /* do not force context switch */ @@ -351,7 +351,7 @@ executing = _Thread_Executing; _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[201].first; + (Thread_Control *) _Chain_First(&(_Thread_Ready_chain[201])); FP_LOAD( 1.0 ); Index: testsuites/tmtests/tm27/task1.c =================================================================== RCS file: /usr1/CVS/rtems/testsuites/tmtests/tm27/task1.c,v retrieving revision 1.22 diff -u -r1.22 task1.c --- testsuites/tmtests/tm27/task1.c 23 Apr 2004 04:51:16 -0000 1.22 +++ testsuites/tmtests/tm27/task1.c 22 Nov 2006 12:32:46 -0000 @@ -170,7 +170,7 @@ _Thread_Dispatch_disable_level = 0; - _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].last; + _Thread_Heir = (rtems_tcb *) _Chain_Last(&(_Thread_Ready_chain[254])); _Context_Switch_necessary = 1; @@ -227,7 +227,7 @@ _Thread_Dispatch_disable_level = 0; - _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].first; + _Thread_Heir = (rtems_tcb *) _Chain_Last(&(_Thread_Ready_chain[254])); _Context_Switch_necessary = 1;