Index: c/src/ChangeLog
===================================================================
--- c/src/ChangeLog	(revision 584ab9e16e52b46ae65cb245fd86858824da4bb9)
+++ c/src/ChangeLog	(revision 534c8936341e980afc4104471e19819e32379df2)
@@ -1,2 +1,8 @@
+2008-12-18	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* libchip/shmdr/dump.c, libchip/shmdr/init.c, libchip/shmdr/send.c,
+	libchip/shmdr/shm_driver.h: Cleanup and remove variables which
+	duplicated data.
+
 2008-12-17	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: c/src/libchip/shmdr/dump.c
===================================================================
--- c/src/libchip/shmdr/dump.c	(revision 584ab9e16e52b46ae65cb245fd86858824da4bb9)
+++ c/src/libchip/shmdr/dump.c	(revision 534c8936341e980afc4104471e19819e32379df2)
@@ -32,6 +32,6 @@
   int         packets_per_second;
 
-  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
-  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );
+  ticks            = rtems_clock_get_ticks_since_boot();
+  ticks_per_second = rtems_clock_get_ticks_per_second();
 
   seconds = ticks / ticks_per_second;
@@ -43,5 +43,6 @@
     packets_per_second++;
 
-  printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n", Shm_Local_node );
+  printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n",
+    Multiprocessing_configuration.node );
   printk( "TICKS SINCE BOOT = %" PRId32 "\n", ticks );
   printk( "TICKS PER SECOND = %" PRId32 "\n", ticks_per_second );
Index: c/src/libchip/shmdr/init.c
===================================================================
--- c/src/libchip/shmdr/init.c	(revision 584ab9e16e52b46ae65cb245fd86858824da4bb9)
+++ c/src/libchip/shmdr/init.c	(revision 534c8936341e980afc4104471e19819e32379df2)
@@ -34,31 +34,28 @@
 rtems_extensions_table MPCI_Shm_extensions;
 
+/*
+ *  MP configuration table from confdefs.h
+ */
+
 rtems_mpci_entry Shm_Initialization( void )
 
 {
-  uint32_t           i, all_initialized;
-  uint32_t           interrupt_cause, interrupt_value;
+  uint32_t                 i, all_initialized;
+  uint32_t                 interrupt_cause, interrupt_value;
   void                    *interrupt_address;
   Shm_Node_status_control *nscb;
-  uint32_t           extension_id;    /* for installation of MPCI_Fatal */
-  uint32_t           remaining_memory;
-/* XXX these should use "public" methods to set their values.... */
-  rtems_configuration_table   *configuration = _Configuration_Table;
-  rtems_multiprocessing_table *mp_configuration = _Configuration_MP_table;
-
-  Shm_RTEMS_Configuration    = configuration;
-  Shm_RTEMS_MP_Configuration = mp_configuration;
-
-  Shm_Local_node    = Shm_RTEMS_MP_Configuration->node;
-  Shm_Maximum_nodes = Shm_RTEMS_MP_Configuration->maximum_nodes;
-
-  Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
+  uint32_t                 extension_id;    /* for installation of MPCI_Fatal */
+  uint32_t                 remaining_memory;
+  uint32_t                 local_node;
+
+  local_node = _Configuration_MP_table->node;
+
+  Shm_Get_configuration( local_node, &Shm_Configuration );
 
   Shm_Interrupt_table = (Shm_Interrupt_information *) malloc(
-    sizeof(Shm_Interrupt_information) * (Shm_Maximum_nodes + 1)
+    sizeof(Shm_Interrupt_information) * (SHM_MAXIMUM_NODES + 1)
   );
 
   assert( Shm_Interrupt_table );
-
 
   Shm_Receive_message_count = 0;
@@ -113,6 +110,6 @@
    */
 
-  Shm_Local_receive_queue  = &Shm_Locked_queues[ Shm_Local_node ];
-  Shm_Local_node_status    = &Shm_Node_statuses[ Shm_Local_node ];
+  Shm_Local_receive_queue  = &Shm_Locked_queues[ local_node ];
+  Shm_Local_node_status    = &Shm_Node_statuses[ local_node ];
 
   /*
@@ -151,5 +148,5 @@
     Shm_Locked_queue_Initialize( FREE_ENV_CB, FREE_ENV_POOL );
 
-    for ( i=SHM_FIRST_NODE ; i<=Shm_Maximum_nodes ; i++ ) {
+    for ( i=SHM_FIRST_NODE ; i<=SHM_MAXIMUM_NODES ; i++ ) {
       Shm_Initialize_receive_queue( i );
 
@@ -186,5 +183,5 @@
       all_initialized = 1;
 
-      for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
+      for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ )
         if ( Shm_Node_statuses[ i ].status != Shm_Initialization_complete )
           all_initialized = 0;
@@ -196,5 +193,5 @@
      */
 
-    for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
+    for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ )
       Shm_Node_statuses[ i ].status = Shm_Active_node;
 
@@ -234,5 +231,5 @@
    */
 
-  for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ ) {
+  for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ ) {
     nscb = &Shm_Node_statuses[ i ];
 
Index: c/src/libchip/shmdr/send.c
===================================================================
--- c/src/libchip/shmdr/send.c	(revision 584ab9e16e52b46ae65cb245fd86858824da4bb9)
+++ c/src/libchip/shmdr/send.c	(revision 534c8936341e980afc4104471e19819e32379df2)
@@ -45,6 +45,6 @@
   }
   else {
-    for( nnum = SHM_FIRST_NODE ; nnum <= Shm_Maximum_nodes ; nnum++ )
-      if ( Shm_Local_node != nnum ) {
+    for( nnum = SHM_FIRST_NODE ; nnum <= SHM_MAXIMUM_NODES ; nnum++ )
+      if ( _Configuration_MP_table->node != nnum ) {
         tmp_ecb = Shm_Allocate_envelope();
         if ( !tmp_ecb )
Index: c/src/libchip/shmdr/shm_driver.h
===================================================================
--- c/src/libchip/shmdr/shm_driver.h	(revision 584ab9e16e52b46ae65cb245fd86858824da4bb9)
+++ c/src/libchip/shmdr/shm_driver.h	(revision 534c8936341e980afc4104471e19819e32379df2)
@@ -228,7 +228,7 @@
 #define START_NS_CBS     ((void *)Shm_Configuration->base)
 #define START_LQ_CBS     ((START_NS_CBS) + \
-        ( (sizeof (Shm_Node_status_control)) * (Shm_Maximum_nodes + 1) ) )
+        ( (sizeof (Shm_Node_status_control)) * (SHM_MAXIMUM_NODES + 1) ) )
 #define START_ENVELOPES  ( ((void *) START_LQ_CBS) + \
-        ( (sizeof (Shm_Locked_queue_Control)) * (Shm_Maximum_nodes + 1) ) )
+        ( (sizeof (Shm_Locked_queue_Control)) * (SHM_MAXIMUM_NODES + 1) ) )
 #define END_SHMCI_AREA    ( (void *) START_ENVELOPES + \
         ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) )
@@ -238,5 +238,5 @@
 
 #define Shm_Is_master_node()  \
-  ( SHM_MASTER == Shm_Local_node )
+  ( SHM_MASTER ==_Configuration_MP_table-> node )
 
 #define Shm_Free_envelope( ecb ) \
@@ -432,4 +432,6 @@
 typedef struct shm_config_info shm_config_table;
 
+#define SHM_MAXIMUM_NODES Multiprocessing_configuration.maximum_nodes
+
 /* global variables */
 
@@ -445,13 +447,10 @@
 SHM_EXTERN Shm_Locked_queue_Control     *Shm_Locked_queues;
 SHM_EXTERN Shm_Envelope_control         *Shm_Envelopes;
-SHM_EXTERN rtems_configuration_table    *Shm_RTEMS_Configuration;
-SHM_EXTERN rtems_multiprocessing_table  *Shm_RTEMS_MP_Configuration;
-SHM_EXTERN uint32_t                Shm_Receive_message_count;
-SHM_EXTERN uint32_t                Shm_Null_message_count;
-SHM_EXTERN uint32_t                Shm_Interrupt_count;
-SHM_EXTERN uint32_t                Shm_Local_node;
-SHM_EXTERN Shm_Locked_queue_Control      *Shm_Local_receive_queue;
-SHM_EXTERN Shm_Node_status_control       *Shm_Local_node_status;
-SHM_EXTERN uint32_t                Shm_isrstat;
+SHM_EXTERN uint32_t                      Shm_Receive_message_count;
+SHM_EXTERN uint32_t                      Shm_Null_message_count;
+SHM_EXTERN uint32_t                      Shm_Interrupt_count;
+SHM_EXTERN Shm_Locked_queue_Control     *Shm_Local_receive_queue;
+SHM_EXTERN Shm_Node_status_control      *Shm_Local_node_status;
+SHM_EXTERN uint32_t                      Shm_isrstat;
                                                      /* reported by shmdr */
 
@@ -460,5 +459,4 @@
 SHM_EXTERN uint32_t   Shm_Active_node;
 
-SHM_EXTERN uint32_t   Shm_Maximum_nodes;
 SHM_EXTERN uint32_t   Shm_Maximum_envelopes;
 
