Changeset e7d8b58 in rtems
- Timestamp:
- 07/31/97 19:01:42 (26 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 13f09e6
- Parents:
- a2fa8c25
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/rtems/headers/message.h
ra2fa8c25 re7d8b58 243 243 244 244 /* 245 * rtems_message_queue_get_number_pending 246 * 247 * DESCRIPTION: 248 * 249 * This routine implements the rtems_message_queue_get_number_pending 250 * directive. This directive returns the number of pending 251 * messages for the message queue indicated by ID 252 * chain. The number of messages pending is returned in COUNT. 253 */ 254 255 rtems_status_code rtems_message_queue_get_number_pending( 256 Objects_Id id, 257 unsigned32 *count 258 ); 259 260 261 /* 245 262 * _Message_queue_Submit 246 263 * -
c/src/exec/rtems/headers/msgmp.h
ra2fa8c25 re7d8b58 35 35 36 36 typedef enum { 37 MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, 38 MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, 39 MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, 40 MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3, 41 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4, 42 MESSAGE_QUEUE_MP_SEND_REQUEST = 5, 43 MESSAGE_QUEUE_MP_SEND_RESPONSE = 6, 44 MESSAGE_QUEUE_MP_URGENT_REQUEST = 7, 45 MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8, 46 MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9, 47 MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10, 48 MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11, 49 MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12 37 MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, 38 MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, 39 MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, 40 MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3, 41 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4, 42 MESSAGE_QUEUE_MP_SEND_REQUEST = 5, 43 MESSAGE_QUEUE_MP_SEND_RESPONSE = 6, 44 MESSAGE_QUEUE_MP_URGENT_REQUEST = 7, 45 MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8, 46 MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9, 47 MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10, 48 MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11, 49 MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12, 50 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST = 13, 51 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14 50 52 } Message_queue_MP_Remote_operations; 51 53 -
c/src/exec/rtems/include/rtems/rtems/message.h
ra2fa8c25 re7d8b58 243 243 244 244 /* 245 * rtems_message_queue_get_number_pending 246 * 247 * DESCRIPTION: 248 * 249 * This routine implements the rtems_message_queue_get_number_pending 250 * directive. This directive returns the number of pending 251 * messages for the message queue indicated by ID 252 * chain. The number of messages pending is returned in COUNT. 253 */ 254 255 rtems_status_code rtems_message_queue_get_number_pending( 256 Objects_Id id, 257 unsigned32 *count 258 ); 259 260 261 /* 245 262 * _Message_queue_Submit 246 263 * -
c/src/exec/rtems/include/rtems/rtems/msgmp.h
ra2fa8c25 re7d8b58 35 35 36 36 typedef enum { 37 MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, 38 MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, 39 MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, 40 MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3, 41 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4, 42 MESSAGE_QUEUE_MP_SEND_REQUEST = 5, 43 MESSAGE_QUEUE_MP_SEND_RESPONSE = 6, 44 MESSAGE_QUEUE_MP_URGENT_REQUEST = 7, 45 MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8, 46 MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9, 47 MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10, 48 MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11, 49 MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12 37 MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, 38 MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, 39 MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, 40 MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3, 41 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4, 42 MESSAGE_QUEUE_MP_SEND_REQUEST = 5, 43 MESSAGE_QUEUE_MP_SEND_RESPONSE = 6, 44 MESSAGE_QUEUE_MP_URGENT_REQUEST = 7, 45 MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8, 46 MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9, 47 MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10, 48 MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11, 49 MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12, 50 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST = 13, 51 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14 50 52 } Message_queue_MP_Remote_operations; 51 53 -
c/src/exec/rtems/src/msg.c
ra2fa8c25 re7d8b58 543 543 case OBJECTS_LOCAL: 544 544 *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); 545 _Thread_Enable_dispatch(); 546 return RTEMS_SUCCESSFUL; 547 } 548 549 return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */ 550 } 551 552 /*PAGE 553 * 554 * rtems_message_queue_get_number_pending 555 * 556 * This directive returns the number of messages pending. 557 * 558 * Input parameters: 559 * id - queue id 560 * count - return area for count 561 * 562 * Output parameters: 563 * count - number of messages removed ( 0 = empty queue ) 564 * RTEMS_SUCCESSFUL - if successful 565 * error code - if unsuccessful 566 */ 567 568 rtems_status_code rtems_message_queue_get_number_pending( 569 Objects_Id id, 570 unsigned32 *count 571 ) 572 { 573 register Message_queue_Control *the_message_queue; 574 Objects_Locations location; 575 576 the_message_queue = _Message_queue_Get( id, &location ); 577 switch ( location ) { 578 case OBJECTS_ERROR: 579 return RTEMS_INVALID_ID; 580 case OBJECTS_REMOTE: 581 _Thread_Executing->Wait.return_argument = count; 582 583 return 584 _Message_queue_MP_Send_request_packet( 585 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST, 586 id, 587 0, /* buffer not used */ 588 0, /* size */ 589 0, /* option_set not used */ 590 MPCI_DEFAULT_TIMEOUT 591 ); 592 593 case OBJECTS_LOCAL: 594 *count = the_message_queue->message_queue.number_of_pending_messages; 545 595 _Thread_Enable_dispatch(); 546 596 return RTEMS_SUCCESSFUL; -
c/src/exec/rtems/src/msgmp.c
ra2fa8c25 re7d8b58 74 74 case MESSAGE_QUEUE_MP_FLUSH_REQUEST: 75 75 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 76 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 77 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 76 78 break; 77 79 … … 102 104 case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: 103 105 case MESSAGE_QUEUE_MP_FLUSH_REQUEST: 106 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 104 107 105 108 the_packet = _Message_queue_MP_Get_packet(); … … 121 124 } 122 125 123 if ( 126 if (! _Options_Is_no_wait(option_set)) 124 127 the_packet->Prefix.timeout = timeout; 125 128 … … 155 158 the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet); 156 159 157 if ( 160 if (! _Options_Is_no_wait(option_set)) 158 161 the_packet->Prefix.timeout = timeout; 159 162 … … 181 184 case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: 182 185 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 186 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 183 187 break; 184 188 } … … 208 212 case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: 209 213 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 214 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 210 215 211 216 the_packet = ( Message_queue_MP_Packet *) the_thread->receive_packet; … … 238 243 case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: 239 244 case MESSAGE_QUEUE_MP_FLUSH_REQUEST: 245 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 240 246 break; 241 247 … … 285 291 the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id ); 286 292 287 if ( 293 if (! _Thread_Is_null( the_thread ) ) 288 294 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 289 295 … … 301 307 ); 302 308 303 if ( 309 if (! _Thread_Is_proxy_blocking( the_packet->Prefix.return_code ) ) 304 310 _Message_queue_MP_Send_response_packet( 305 311 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE, … … 383 389 case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: 384 390 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 391 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 385 392 386 393 the_thread = _MPCI_Process_response( the_packet_prefix ); … … 400 407 _Message_queue_MP_Send_response_packet( 401 408 MESSAGE_QUEUE_MP_FLUSH_RESPONSE, 409 the_packet->Prefix.id, 410 _Thread_Executing 411 ); 412 break; 413 414 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 415 416 the_packet->Prefix.return_code = rtems_message_queue_get_number_pending( 417 the_packet->Prefix.id, 418 &the_packet->count 419 ); 420 421 _Message_queue_MP_Send_response_packet( 422 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE, 402 423 the_packet->Prefix.id, 403 424 _Thread_Executing -
cpukit/rtems/include/rtems/rtems/message.h
ra2fa8c25 re7d8b58 243 243 244 244 /* 245 * rtems_message_queue_get_number_pending 246 * 247 * DESCRIPTION: 248 * 249 * This routine implements the rtems_message_queue_get_number_pending 250 * directive. This directive returns the number of pending 251 * messages for the message queue indicated by ID 252 * chain. The number of messages pending is returned in COUNT. 253 */ 254 255 rtems_status_code rtems_message_queue_get_number_pending( 256 Objects_Id id, 257 unsigned32 *count 258 ); 259 260 261 /* 245 262 * _Message_queue_Submit 246 263 * -
cpukit/rtems/include/rtems/rtems/msgmp.h
ra2fa8c25 re7d8b58 35 35 36 36 typedef enum { 37 MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, 38 MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, 39 MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, 40 MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3, 41 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4, 42 MESSAGE_QUEUE_MP_SEND_REQUEST = 5, 43 MESSAGE_QUEUE_MP_SEND_RESPONSE = 6, 44 MESSAGE_QUEUE_MP_URGENT_REQUEST = 7, 45 MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8, 46 MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9, 47 MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10, 48 MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11, 49 MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12 37 MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, 38 MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, 39 MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, 40 MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3, 41 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4, 42 MESSAGE_QUEUE_MP_SEND_REQUEST = 5, 43 MESSAGE_QUEUE_MP_SEND_RESPONSE = 6, 44 MESSAGE_QUEUE_MP_URGENT_REQUEST = 7, 45 MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8, 46 MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9, 47 MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10, 48 MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11, 49 MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12, 50 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST = 13, 51 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14 50 52 } Message_queue_MP_Remote_operations; 51 53 -
cpukit/rtems/src/msg.c
ra2fa8c25 re7d8b58 543 543 case OBJECTS_LOCAL: 544 544 *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); 545 _Thread_Enable_dispatch(); 546 return RTEMS_SUCCESSFUL; 547 } 548 549 return RTEMS_INTERNAL_ERROR; /* unreached - only to remove warnings */ 550 } 551 552 /*PAGE 553 * 554 * rtems_message_queue_get_number_pending 555 * 556 * This directive returns the number of messages pending. 557 * 558 * Input parameters: 559 * id - queue id 560 * count - return area for count 561 * 562 * Output parameters: 563 * count - number of messages removed ( 0 = empty queue ) 564 * RTEMS_SUCCESSFUL - if successful 565 * error code - if unsuccessful 566 */ 567 568 rtems_status_code rtems_message_queue_get_number_pending( 569 Objects_Id id, 570 unsigned32 *count 571 ) 572 { 573 register Message_queue_Control *the_message_queue; 574 Objects_Locations location; 575 576 the_message_queue = _Message_queue_Get( id, &location ); 577 switch ( location ) { 578 case OBJECTS_ERROR: 579 return RTEMS_INVALID_ID; 580 case OBJECTS_REMOTE: 581 _Thread_Executing->Wait.return_argument = count; 582 583 return 584 _Message_queue_MP_Send_request_packet( 585 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST, 586 id, 587 0, /* buffer not used */ 588 0, /* size */ 589 0, /* option_set not used */ 590 MPCI_DEFAULT_TIMEOUT 591 ); 592 593 case OBJECTS_LOCAL: 594 *count = the_message_queue->message_queue.number_of_pending_messages; 545 595 _Thread_Enable_dispatch(); 546 596 return RTEMS_SUCCESSFUL; -
cpukit/rtems/src/msgmp.c
ra2fa8c25 re7d8b58 74 74 case MESSAGE_QUEUE_MP_FLUSH_REQUEST: 75 75 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 76 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 77 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 76 78 break; 77 79 … … 102 104 case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: 103 105 case MESSAGE_QUEUE_MP_FLUSH_REQUEST: 106 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 104 107 105 108 the_packet = _Message_queue_MP_Get_packet(); … … 121 124 } 122 125 123 if ( 126 if (! _Options_Is_no_wait(option_set)) 124 127 the_packet->Prefix.timeout = timeout; 125 128 … … 155 158 the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet); 156 159 157 if ( 160 if (! _Options_Is_no_wait(option_set)) 158 161 the_packet->Prefix.timeout = timeout; 159 162 … … 181 184 case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: 182 185 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 186 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 183 187 break; 184 188 } … … 208 212 case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: 209 213 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 214 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 210 215 211 216 the_packet = ( Message_queue_MP_Packet *) the_thread->receive_packet; … … 238 243 case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: 239 244 case MESSAGE_QUEUE_MP_FLUSH_REQUEST: 245 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 240 246 break; 241 247 … … 285 291 the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id ); 286 292 287 if ( 293 if (! _Thread_Is_null( the_thread ) ) 288 294 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 289 295 … … 301 307 ); 302 308 303 if ( 309 if (! _Thread_Is_proxy_blocking( the_packet->Prefix.return_code ) ) 304 310 _Message_queue_MP_Send_response_packet( 305 311 MESSAGE_QUEUE_MP_RECEIVE_RESPONSE, … … 383 389 case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: 384 390 case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: 391 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: 385 392 386 393 the_thread = _MPCI_Process_response( the_packet_prefix ); … … 400 407 _Message_queue_MP_Send_response_packet( 401 408 MESSAGE_QUEUE_MP_FLUSH_RESPONSE, 409 the_packet->Prefix.id, 410 _Thread_Executing 411 ); 412 break; 413 414 case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: 415 416 the_packet->Prefix.return_code = rtems_message_queue_get_number_pending( 417 the_packet->Prefix.id, 418 &the_packet->count 419 ); 420 421 _Message_queue_MP_Send_response_packet( 422 MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE, 402 423 the_packet->Prefix.id, 403 424 _Thread_Executing
Note: See TracChangeset
for help on using the changeset viewer.