void _Message_queue_MP_Process_packet ( rtems_packet_prefix *the_packet_prefix ) { Message_queue_MP_Packet *the_packet; Thread_Control *the_thread; bool ignored; the_packet = (Message_queue_MP_Packet *) the_packet_prefix; switch ( the_packet->operation ) { case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE: ignored = _Objects_MP_Allocate_and_open( &_Message_queue_Information, the_packet->name, the_packet->Prefix.id, true ); _MPCI_Return_packet( the_packet_prefix ); break; case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE: _Objects_MP_Close( &_Message_queue_Information, the_packet->Prefix.id ); _MPCI_Return_packet( the_packet_prefix ); break; case MESSAGE_QUEUE_MP_EXTRACT_PROXY: the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id ); if (! _Thread_Is_null( the_thread ) ) _Thread_queue_Extract( the_thread ); _MPCI_Return_packet( the_packet_prefix ); break; case MESSAGE_QUEUE_MP_RECEIVE_REQUEST: the_packet->Prefix.return_code = rtems_message_queue_receive( the_packet->Prefix.id, the_packet->Buffer.buffer, &the_packet->size, the_packet->option_set, the_packet->Prefix.timeout ); if ( the_packet->Prefix.return_code != RTEMS_PROXY_BLOCKING ) _Message_queue_MP_Send_response_packet( MESSAGE_QUEUE_MP_RECEIVE_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE: the_thread = _MPCI_Process_response( the_packet_prefix ); if (the_packet->Prefix.return_code == RTEMS_SUCCESSFUL) { *(size_t *) the_thread->Wait.return_argument = the_packet->size; _CORE_message_queue_Copy_buffer( the_packet->Buffer.buffer, the_thread->Wait.return_argument_second.mutable_object, the_packet->size ); } _MPCI_Return_packet( the_packet_prefix ); break; case MESSAGE_QUEUE_MP_SEND_REQUEST: the_packet->Prefix.return_code = rtems_message_queue_send( the_packet->Prefix.id, the_packet->Buffer.buffer, the_packet->Buffer.size ); _Message_queue_MP_Send_response_packet( MESSAGE_QUEUE_MP_SEND_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; case MESSAGE_QUEUE_MP_SEND_RESPONSE: case MESSAGE_QUEUE_MP_URGENT_RESPONSE: the_thread = _MPCI_Process_response( the_packet_prefix ); _MPCI_Return_packet( the_packet_prefix ); break; case MESSAGE_QUEUE_MP_URGENT_REQUEST: the_packet->Prefix.return_code = rtems_message_queue_urgent( the_packet->Prefix.id, the_packet->Buffer.buffer, the_packet->Buffer.size ); _Message_queue_MP_Send_response_packet( MESSAGE_QUEUE_MP_URGENT_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: the_packet->Prefix.return_code = rtems_message_queue_broadcast( the_packet->Prefix.id, the_packet->Buffer.buffer, the_packet->Buffer.size, &the_packet->count ); _Message_queue_MP_Send_response_packet( MESSAGE_QUEUE_MP_BROADCAST_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: the_thread = _MPCI_Process_response( the_packet_prefix ); *(uint32_t *) the_thread->Wait.return_argument = the_packet->count; _MPCI_Return_packet( the_packet_prefix ); break; case MESSAGE_QUEUE_MP_FLUSH_REQUEST: the_packet->Prefix.return_code = rtems_message_queue_flush( the_packet->Prefix.id, &the_packet->count ); _Message_queue_MP_Send_response_packet( MESSAGE_QUEUE_MP_FLUSH_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: the_packet->Prefix.return_code = rtems_message_queue_get_number_pending( the_packet->Prefix.id, &the_packet->count ); _Message_queue_MP_Send_response_packet( MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; } }
void _Partition_MP_Process_packet ( rtems_packet_prefix *the_packet_prefix ) { Partition_MP_Packet *the_packet; Thread_Control *the_thread; the_packet = (Partition_MP_Packet *) the_packet_prefix; switch ( the_packet->operation ) { case PARTITION_MP_ANNOUNCE_CREATE: _Objects_MP_Allocate_and_open( &_Partition_Information, the_packet->name, the_packet->Prefix.id, true ); _MPCI_Return_packet( the_packet_prefix ); break; case PARTITION_MP_ANNOUNCE_DELETE: _Objects_MP_Close( &_Partition_Information, the_packet->Prefix.id ); _MPCI_Return_packet( the_packet_prefix ); break; case PARTITION_MP_EXTRACT_PROXY: the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id ); if ( ! _Thread_Is_null( the_thread ) ) _Thread_queue_Extract( the_thread ); _MPCI_Return_packet( the_packet_prefix ); break; case PARTITION_MP_GET_BUFFER_REQUEST: the_packet->Prefix.return_code = rtems_partition_get_buffer( the_packet->Prefix.id, &the_packet->buffer ); _Partition_MP_Send_response_packet( PARTITION_MP_GET_BUFFER_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; case PARTITION_MP_GET_BUFFER_RESPONSE: the_thread = _MPCI_Process_response( the_packet_prefix ); *(void **)the_thread->Wait.return_argument = the_packet->buffer; _MPCI_Return_packet( the_packet_prefix ); break; case PARTITION_MP_RETURN_BUFFER_REQUEST: the_packet->Prefix.return_code = rtems_partition_return_buffer( the_packet->Prefix.id, the_packet->buffer ); _Partition_MP_Send_response_packet( PARTITION_MP_RETURN_BUFFER_RESPONSE, the_packet->Prefix.id, _Thread_Executing ); break; case PARTITION_MP_RETURN_BUFFER_RESPONSE: the_thread = _MPCI_Process_response( the_packet_prefix ); _MPCI_Return_packet( the_packet_prefix ); break; } }