Index: c/src/exec/score/include/rtems/score/coremsg.h
===================================================================
--- c/src/exec/score/include/rtems/score/coremsg.h	(revision af10d3ef5d921d04ec4e3870e229c2c50620d3ce)
+++ c/src/exec/score/include/rtems/score/coremsg.h	(revision 9693fdac7518e4d6d37b41dc1675b4041d54d900)
@@ -57,4 +57,5 @@
 typedef struct {
   Chain_Node                 Node;
+  int                        priority;
   CORE_message_queue_Buffer  Contents;
 }   CORE_message_queue_Buffer_control;
@@ -73,10 +74,15 @@
  *  may be submitted to a message queue.  The message may be posted
  *  in a send or urgent fashion.
- */
- 
-typedef enum {
-  CORE_MESSAGE_QUEUE_SEND_REQUEST   = 0,
-  CORE_MESSAGE_QUEUE_URGENT_REQUEST = 1
-}  CORE_message_queue_Submit_types;
+ *
+ *  NOTE:  All other values are message priorities.  Numerically smaller
+ *         priorities indicate higher priority messages.
+ *
+ *  XXX these constants should be changed to be compiler dependent.
+ */
+ 
+#define  CORE_MESSAGE_QUEUE_SEND_REQUEST   0x7fffffff
+#define  CORE_MESSAGE_QUEUE_URGENT_REQUEST -(0x7fffffff)
+
+typedef int CORE_message_queue_Submit_types;
 
 /*
Index: c/src/exec/score/src/coremsg.c
===================================================================
--- c/src/exec/score/src/coremsg.c	(revision af10d3ef5d921d04ec4e3870e229c2c50620d3ce)
+++ c/src/exec/score/src/coremsg.c	(revision 9693fdac7518e4d6d37b41dc1675b4041d54d900)
@@ -423,5 +423,6 @@
   _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size );
   the_message->Contents.size = size;
-  
+  the_message->priority  = submit_type;
+
   the_message_queue->number_of_pending_messages += 1;
 
@@ -433,6 +434,37 @@
       _CORE_message_queue_Prepend( the_message_queue, the_message );
       break;
-  }
-
+    default:
+      /* XXX interrupt critical section needs to be addressed */
+      {
+        CORE_message_queue_Buffer_control *this_message;
+        Chain_Node                        *the_node;
+
+        the_message->priority = submit_type;
+        for ( the_node = the_message_queue->Pending_messages.first ;
+           !_Chain_Is_tail( &the_message_queue->Pending_messages, the_node ) ;
+           the_node = the_node->next ) {
+
+          this_message = (CORE_message_queue_Buffer_control *) the_node;
+
+          if ( this_message->priority >= the_message->priority )
+            continue;
+
+          _Chain_Insert( the_node, &the_message->Node );
+          break;
+        }
+      }
+      break;
+  }
+
+  /*
+   *  According to POSIX, does this happen before or after the message
+   *  is actually enqueued.  It is logical to think afterwards, because
+   *  the message is actually in the queue at this point.
+   */
+
+  if ( the_message_queue->number_of_pending_messages == 1 && 
+       the_message_queue->notify_handler )
+    (*the_message_queue->notify_handler)( the_message_queue->notify_argument );
+  
   return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
 }
Index: cpukit/score/include/rtems/score/coremsg.h
===================================================================
--- cpukit/score/include/rtems/score/coremsg.h	(revision af10d3ef5d921d04ec4e3870e229c2c50620d3ce)
+++ cpukit/score/include/rtems/score/coremsg.h	(revision 9693fdac7518e4d6d37b41dc1675b4041d54d900)
@@ -57,4 +57,5 @@
 typedef struct {
   Chain_Node                 Node;
+  int                        priority;
   CORE_message_queue_Buffer  Contents;
 }   CORE_message_queue_Buffer_control;
@@ -73,10 +74,15 @@
  *  may be submitted to a message queue.  The message may be posted
  *  in a send or urgent fashion.
- */
- 
-typedef enum {
-  CORE_MESSAGE_QUEUE_SEND_REQUEST   = 0,
-  CORE_MESSAGE_QUEUE_URGENT_REQUEST = 1
-}  CORE_message_queue_Submit_types;
+ *
+ *  NOTE:  All other values are message priorities.  Numerically smaller
+ *         priorities indicate higher priority messages.
+ *
+ *  XXX these constants should be changed to be compiler dependent.
+ */
+ 
+#define  CORE_MESSAGE_QUEUE_SEND_REQUEST   0x7fffffff
+#define  CORE_MESSAGE_QUEUE_URGENT_REQUEST -(0x7fffffff)
+
+typedef int CORE_message_queue_Submit_types;
 
 /*
Index: cpukit/score/src/coremsg.c
===================================================================
--- cpukit/score/src/coremsg.c	(revision af10d3ef5d921d04ec4e3870e229c2c50620d3ce)
+++ cpukit/score/src/coremsg.c	(revision 9693fdac7518e4d6d37b41dc1675b4041d54d900)
@@ -423,5 +423,6 @@
   _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size );
   the_message->Contents.size = size;
-  
+  the_message->priority  = submit_type;
+
   the_message_queue->number_of_pending_messages += 1;
 
@@ -433,6 +434,37 @@
       _CORE_message_queue_Prepend( the_message_queue, the_message );
       break;
-  }
-
+    default:
+      /* XXX interrupt critical section needs to be addressed */
+      {
+        CORE_message_queue_Buffer_control *this_message;
+        Chain_Node                        *the_node;
+
+        the_message->priority = submit_type;
+        for ( the_node = the_message_queue->Pending_messages.first ;
+           !_Chain_Is_tail( &the_message_queue->Pending_messages, the_node ) ;
+           the_node = the_node->next ) {
+
+          this_message = (CORE_message_queue_Buffer_control *) the_node;
+
+          if ( this_message->priority >= the_message->priority )
+            continue;
+
+          _Chain_Insert( the_node, &the_message->Node );
+          break;
+        }
+      }
+      break;
+  }
+
+  /*
+   *  According to POSIX, does this happen before or after the message
+   *  is actually enqueued.  It is logical to think afterwards, because
+   *  the message is actually in the queue at this point.
+   */
+
+  if ( the_message_queue->number_of_pending_messages == 1 && 
+       the_message_queue->notify_handler )
+    (*the_message_queue->notify_handler)( the_message_queue->notify_argument );
+  
   return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
 }
