Changeset 9693fdac in rtems
- Timestamp:
- 11/02/99 15:57:58 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 8f0529f
- Parents:
- af10d3ef
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/include/rtems/score/coremsg.h
raf10d3ef r9693fdac 57 57 typedef struct { 58 58 Chain_Node Node; 59 int priority; 59 60 CORE_message_queue_Buffer Contents; 60 61 } CORE_message_queue_Buffer_control; … … 73 74 * may be submitted to a message queue. The message may be posted 74 75 * in a send or urgent fashion. 75 */ 76 77 typedef enum { 78 CORE_MESSAGE_QUEUE_SEND_REQUEST = 0, 79 CORE_MESSAGE_QUEUE_URGENT_REQUEST = 1 80 } CORE_message_queue_Submit_types; 76 * 77 * NOTE: All other values are message priorities. Numerically smaller 78 * priorities indicate higher priority messages. 79 * 80 * XXX these constants should be changed to be compiler dependent. 81 */ 82 83 #define CORE_MESSAGE_QUEUE_SEND_REQUEST 0x7fffffff 84 #define CORE_MESSAGE_QUEUE_URGENT_REQUEST -(0x7fffffff) 85 86 typedef int CORE_message_queue_Submit_types; 81 87 82 88 /* -
c/src/exec/score/src/coremsg.c
raf10d3ef r9693fdac 423 423 _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); 424 424 the_message->Contents.size = size; 425 425 the_message->priority = submit_type; 426 426 427 the_message_queue->number_of_pending_messages += 1; 427 428 … … 433 434 _CORE_message_queue_Prepend( the_message_queue, the_message ); 434 435 break; 435 } 436 436 default: 437 /* XXX interrupt critical section needs to be addressed */ 438 { 439 CORE_message_queue_Buffer_control *this_message; 440 Chain_Node *the_node; 441 442 the_message->priority = submit_type; 443 for ( the_node = the_message_queue->Pending_messages.first ; 444 !_Chain_Is_tail( &the_message_queue->Pending_messages, the_node ) ; 445 the_node = the_node->next ) { 446 447 this_message = (CORE_message_queue_Buffer_control *) the_node; 448 449 if ( this_message->priority >= the_message->priority ) 450 continue; 451 452 _Chain_Insert( the_node, &the_message->Node ); 453 break; 454 } 455 } 456 break; 457 } 458 459 /* 460 * According to POSIX, does this happen before or after the message 461 * is actually enqueued. It is logical to think afterwards, because 462 * the message is actually in the queue at this point. 463 */ 464 465 if ( the_message_queue->number_of_pending_messages == 1 && 466 the_message_queue->notify_handler ) 467 (*the_message_queue->notify_handler)( the_message_queue->notify_argument ); 468 437 469 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 438 470 } -
cpukit/score/include/rtems/score/coremsg.h
raf10d3ef r9693fdac 57 57 typedef struct { 58 58 Chain_Node Node; 59 int priority; 59 60 CORE_message_queue_Buffer Contents; 60 61 } CORE_message_queue_Buffer_control; … … 73 74 * may be submitted to a message queue. The message may be posted 74 75 * in a send or urgent fashion. 75 */ 76 77 typedef enum { 78 CORE_MESSAGE_QUEUE_SEND_REQUEST = 0, 79 CORE_MESSAGE_QUEUE_URGENT_REQUEST = 1 80 } CORE_message_queue_Submit_types; 76 * 77 * NOTE: All other values are message priorities. Numerically smaller 78 * priorities indicate higher priority messages. 79 * 80 * XXX these constants should be changed to be compiler dependent. 81 */ 82 83 #define CORE_MESSAGE_QUEUE_SEND_REQUEST 0x7fffffff 84 #define CORE_MESSAGE_QUEUE_URGENT_REQUEST -(0x7fffffff) 85 86 typedef int CORE_message_queue_Submit_types; 81 87 82 88 /* -
cpukit/score/src/coremsg.c
raf10d3ef r9693fdac 423 423 _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); 424 424 the_message->Contents.size = size; 425 425 the_message->priority = submit_type; 426 426 427 the_message_queue->number_of_pending_messages += 1; 427 428 … … 433 434 _CORE_message_queue_Prepend( the_message_queue, the_message ); 434 435 break; 435 } 436 436 default: 437 /* XXX interrupt critical section needs to be addressed */ 438 { 439 CORE_message_queue_Buffer_control *this_message; 440 Chain_Node *the_node; 441 442 the_message->priority = submit_type; 443 for ( the_node = the_message_queue->Pending_messages.first ; 444 !_Chain_Is_tail( &the_message_queue->Pending_messages, the_node ) ; 445 the_node = the_node->next ) { 446 447 this_message = (CORE_message_queue_Buffer_control *) the_node; 448 449 if ( this_message->priority >= the_message->priority ) 450 continue; 451 452 _Chain_Insert( the_node, &the_message->Node ); 453 break; 454 } 455 } 456 break; 457 } 458 459 /* 460 * According to POSIX, does this happen before or after the message 461 * is actually enqueued. It is logical to think afterwards, because 462 * the message is actually in the queue at this point. 463 */ 464 465 if ( the_message_queue->number_of_pending_messages == 1 && 466 the_message_queue->notify_handler ) 467 (*the_message_queue->notify_handler)( the_message_queue->notify_argument ); 468 437 469 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 438 470 }
Note: See TracChangeset
for help on using the changeset viewer.