Index: c/src/libchip/shmdr/init.c
===================================================================
--- c/src/libchip/shmdr/init.c	(revision 88d594a3d52cb5938521619bca0def8e5b040cf0)
+++ c/src/libchip/shmdr/init.c	(revision 12f86efd881609f271cdd65308edfe18d8e88c2f)
@@ -23,11 +23,13 @@
 
 #include <rtems.h>
-#include "shm.h"
+#include <shm.h>
+
+#include <string.h>    /* memset() */
 
 /*
- * Need a user extension control to install MPCI_Fatal as
- *  a fatal error handler extension
+ * User extension to install MPCI_Fatal as a fatal error
+ * handler extension
  */
-
+ 
 rtems_extensions_table MPCI_Shm_extensions;
 
@@ -39,5 +41,5 @@
 )
 {
-  rtems_unsigned32         i, *u32_ptr, *endshm, all_initialized;
+  rtems_unsigned32         i, all_initialized;
   rtems_unsigned32         interrupt_cause, interrupt_value;
   void                    *interrupt_address;
@@ -52,5 +54,5 @@
   Shm_Maximum_nodes = Shm_RTEMS_MP_Configuration->maximum_nodes;
 
-  Shm_Get_configuration( Shm_Local_node ,&Shm_Configuration );
+  Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
 
   Shm_Receive_message_count = 0;
@@ -62,11 +64,10 @@
    */
 
-#define PEND Shm_Convert(rtems_build_name( 'P', 'E', 'N', 'D' ))
-#define COMP Shm_Convert(rtems_build_name( 'C', 'O', 'M', 'P' ))
-#define ACTV Shm_Convert(rtems_build_name( 'A', 'C', 'T', 'V' ))
-
-  Shm_Pending_initialization  = PEND;
-  Shm_Initialization_complete = COMP;
-  Shm_Active_node             = ACTV;
+  Shm_Pending_initialization = 
+    Shm_Convert(rtems_build_name( 'P', 'E', 'N', 'D' ));
+  Shm_Initialization_complete = 
+    Shm_Convert(rtems_build_name( 'C', 'O', 'M', 'P' ));
+  Shm_Active_node = 
+    Shm_Convert(rtems_build_name( 'A', 'C', 'T', 'V' ));
 
   /*
@@ -129,8 +130,9 @@
      */
 
-    for ( u32_ptr = (rtems_unsigned32 *)Shm_Configuration->base,
-          endshm = (rtems_unsigned32 *)END_SHARED_MEM ;
-          u32_ptr < endshm ; )
-      *u32_ptr++ = 0;
+    (void) memset(
+      (void *) Shm_Configuration->base,
+      0,
+      Shm_Configuration->length
+    );
 
     /*
@@ -175,10 +177,5 @@
      */
 
-    all_initialized = 0;
-
-    for ( ; ; ) {
-
-      if ( all_initialized == 1 ) break;
-
+    do {
       all_initialized = 1;
 
@@ -186,5 +183,6 @@
         if ( Shm_Node_statuses[ i ].status != Shm_Initialization_complete )
           all_initialized = 0;
-    }
+
+    } while ( all_initialized == 0 );
 
     /*
Index: c/src/libchip/shmdr/mpci.h
===================================================================
--- c/src/libchip/shmdr/mpci.h	(revision 88d594a3d52cb5938521619bca0def8e5b040cf0)
+++ c/src/libchip/shmdr/mpci.h	(revision 12f86efd881609f271cdd65308edfe18d8e88c2f)
@@ -23,5 +23,5 @@
 #endif
 
-#include "shm.h"
+#include <shm.h>
 
 #define MPCI_Initialization( _configuration ) \
Index: c/src/libchip/shmdr/poll.c
===================================================================
--- c/src/libchip/shmdr/poll.c	(revision 88d594a3d52cb5938521619bca0def8e5b040cf0)
+++ c/src/libchip/shmdr/poll.c	(revision 12f86efd881609f271cdd65308edfe18d8e88c2f)
@@ -45,7 +45,8 @@
       tmpfront = Shm_Local_receive_queue->front;
       Shm_Unlock( Shm_Local_receive_queue );
-      if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
-      rtems_multiprocessing_announce();
-      Shm_Interrupt_count++;
+      if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list ) {
+        rtems_multiprocessing_announce();
+        Shm_Interrupt_count++;
+      }
   }
 }
Index: c/src/libchip/shmdr/shm_driver.h
===================================================================
--- c/src/libchip/shmdr/shm_driver.h	(revision 88d594a3d52cb5938521619bca0def8e5b040cf0)
+++ c/src/libchip/shmdr/shm_driver.h	(revision 12f86efd881609f271cdd65308edfe18d8e88c2f)
@@ -173,14 +173,27 @@
 
 #define NULL_ENV_CB             ((Shm_Envelope_control *) 0)
-#define NULL_SHM_INFO           ((struct shm_info *) 0)
 #define NULL_CONVERT            0
-#if 0
-#define NULL_CONVERT            (((rtems_unsigned32 *)())0) /* we want this */
-#endif
-
-/* The following is adjusted so envelopes are 0x80 bytes long. */
-/* It should be >= MIN_PKT_SIZE in rtems.h                     */
-
-#define MAX_PACKET_SIZE          (80)
+
+/*
+ * size of stuff before preamble in envelope.
+ * It must be a constant since we will use it to generate MAX_PACKET_SIZE
+ */
+ 
+#define SHM_ENVELOPE_PREFIX_OVERHEAD    (4 * sizeof(vol_u32))
+
+/*
+ *  The following is adjusted so envelopes are MAX_ENVELOPE_SIZE bytes long.
+ *  It must be >= RTEMS_MINIMUM_PACKET_SIZE in mppkt.h.
+ */
+ 
+#ifndef MAX_ENVELOPE_SIZE
+#define MAX_ENVELOPE_SIZE 0x180
+#endif
+
+#define MAX_PACKET_SIZE  (MAX_ENVELOPE_SIZE -               \
+                          SHM_ENVELOPE_PREFIX_OVERHEAD +    \
+                          sizeof(Shm_Envelope_preamble) +   \
+                          sizeof(Shm_Envelope_postamble))
+
 
 /* constants pertinent to Locked Queue routines */
@@ -200,15 +213,4 @@
  *        is defined in a system dependent file.
  */
-
-#if 0
-#define START_NS_CBS     ( (rtems_unsigned8 *) START_SHARED_MEM )
-#define START_LQ_CBS     ( ((rtems_unsigned8 *) START_NS_CBS) + \
-        ( (sizeof (Shm_Node_status_control)) * (Shm_Maximum_nodes + 1) ) )
-#define START_ENVELOPES  ( ((rtems_unsigned8 *) START_LQ_CBS) + \
-        ( (sizeof (Shm_Locked_queue_Control)) * (Shm_Maximum_nodes + 1) ) )
-#define END_SHMCI_AREA    ( (rtems_unsigned8 *) START_ENVELOPES + \
-        ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) )
-#define END_SHARED_MEM   ((rtems_unsigned32)START_SHARED_MEM+SHARED_MEM_LEN)
-#endif
 
 #define START_NS_CBS     ((void *)Shm_Configuration->base)
@@ -223,5 +225,5 @@
 /* macros */
 
-#define Shm_Is_master_node() \
+#define Shm_Is_master_node()  \
   ( SHM_MASTER == Shm_Local_node )
 
@@ -242,5 +244,5 @@
 #define Shm_Packet_prefix_to_envelope_control_pointer( pkt )   \
    ((Shm_Envelope_control *)((rtems_unsigned8 *)(pkt) - \
-   (sizeof(Shm_Envelope_preamble) + 4*sizeof(vol_u32))))
+   (sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD)))
 
 #define Shm_Build_preamble(ecb, node) \
@@ -249,5 +251,5 @@
 #define Shm_Build_postamble( ecb )
 
-/* structures */
+/* volatile types */
 
 typedef volatile rtems_unsigned8  vol_u8;
@@ -272,13 +274,8 @@
 
 typedef struct {
-  vol_u32 not_currently_used_0;
-  vol_u32 not_currently_used_1;
-  vol_u32 not_currently_used_2;
-  vol_u32 not_currently_used_3;
-  /*byte end_of_text;*/
-} Shm_Envelope_postable;
+} Shm_Envelope_postamble;
 
 /* WARNING! If you change this structure, don't forget to change
- *          Shm_Envelope_control_to_packet_prefix_pointer() and
+ *          SHM_ENVELOPE_PREFIX_OVERHEAD and
  *          Shm_Packet_prefix_to_envelope_control_pointer() above.
  */
@@ -306,5 +303,5 @@
   Shm_Envelope_preamble    Preamble; /* header information           */
   vol_u8            packet[MAX_PACKET_SIZE]; /* RTEMS INFO    */
-  Shm_Envelope_postable   Postamble;/* trailer information          */
+  Shm_Envelope_postamble   Postamble;/* trailer information          */
 } Shm_Envelope_control;
 
@@ -514,4 +511,6 @@
 );
 
+extern rtems_mpci_table MPCI_table;
+
 #ifdef _SHM_INIT
 
@@ -527,8 +526,4 @@
 };
 
-#else
-
-extern rtems_mpci_table MPCI_table;
-
 #endif
 
