RTEMS CPU Kit with SuperCore  4.10.99.0
Data Structures | Enumerations | Functions | Variables
Message Queues
RTEMS Classic API

Message Queue Manager. More...

Collaboration diagram for Message Queues:

Data Structures

struct  Message_queue_Control
 The following records define the control block used to manage each message queue. More...

Enumerations

enum  Message_queue_Submit_types { MESSAGE_QUEUE_SEND_REQUEST = 0, MESSAGE_QUEUE_URGENT_REQUEST = 1 }
 The following enumerated type details the modes in which a message may be submitted to a message queue. More...

Functions

void _Message_queue_Manager_initialization (void)
 Message Queue Manager Initialization.
rtems_status_code rtems_message_queue_create (rtems_name name, uint32_t count, size_t max_message_size, rtems_attribute attribute_set, rtems_id *id)
 RTEMS Create Message Queue.
rtems_status_code rtems_message_queue_ident (rtems_name name, uint32_t node, rtems_id *id)
 RTEMS Message Queue Name to Id.
rtems_status_code rtems_message_queue_delete (rtems_id id)
 RTEMS Delete Message Queue.
rtems_status_code rtems_message_queue_send (rtems_id id, const void *buffer, size_t size)
 rtems_message_queue_send
rtems_status_code rtems_message_queue_urgent (rtems_id id, const void *buffer, size_t size)
 RTEMS Urgent Message Queue.
rtems_status_code rtems_message_queue_broadcast (rtems_id id, const void *buffer, size_t size, uint32_t *count)
 RTEMS Broadcast Message Queue.
rtems_status_code rtems_message_queue_receive (rtems_id id, void *buffer, size_t *size, rtems_option option_set, rtems_interval timeout)
 RTEMS Message Queue Receive.
rtems_status_code rtems_message_queue_flush (rtems_id id, uint32_t *count)
 rtems_message_queue_flush
rtems_status_code rtems_message_queue_get_number_pending (rtems_id id, uint32_t *count)
 RTEMS Message Queue Get Number Pending.
rtems_status_code _Message_queue_Submit (rtems_id id, const void *buffer, size_t size, Message_queue_Submit_types submit_type)
 Message_queue_Submit.
Message_queue_Control_Message_queue_Allocate (void)
 Message Queue Allocate.
rtems_status_code _Message_queue_Translate_core_message_queue_return_code (uint32_t the_message_queue_status)
 Message queue Translate Core Message Queue Return Code.
void _Message_queue_Core_message_queue_mp_support (Thread_Control *the_thread, rtems_id id)
 Message_queue_Core_message_queue_mp_support.
RTEMS_INLINE_ROUTINE bool _Message_queue_Is_null (Message_queue_Control *the_message_queue)
 Check whether message queue is null.
RTEMS_INLINE_ROUTINE void _Message_queue_Free (Message_queue_Control *the_message_queue)
 Deallocates a message queue control block into the inactive chain of free message queue control blocks.
RTEMS_INLINE_ROUTINE
Message_queue_Control
_Message_queue_Get (Objects_Id id, Objects_Locations *location)
 Maps message queue IDs to message queue control blocks.

Variables

RTEMS_MESSAGE_EXTERN
Objects_Information 
_Message_queue_Information
 The following defines the information control block used to manage this class of objects.

Detailed Description

Message Queue Manager.

This encapsulates functionality which XXX.

This include file contains all the constants and structures associated with the Message Queue Manager. This manager provides a mechanism for communication and synchronization between tasks using messages.

Directives provided are:


Enumeration Type Documentation

The following enumerated type details the modes in which a message may be submitted to a message queue.

The message may be posted in a send or urgent fashion.

Enumerator:
MESSAGE_QUEUE_SEND_REQUEST 

This value indicates the user wants to send the message using the normal message insertion protocol (FIFO or priority).

MESSAGE_QUEUE_URGENT_REQUEST 

This value indicates the user considers the message to be urgent and wants it inserted at the head of the pending message queue.


Function Documentation

Message_queue_Control* _Message_queue_Allocate ( void  )

Message Queue Allocate.

This function allocates a message queue control block from the inactive chain of free message queue control blocks.

Return values:
the_message_queuefilled in if successful, NULL otherwise
void _Message_queue_Core_message_queue_mp_support ( Thread_Control the_thread,
rtems_id  id 
)

Message_queue_Core_message_queue_mp_support.

Input parameters: the_thread - the remote thread the message was submitted to id - id of the message queue

Output parameters: NONE

RTEMS_INLINE_ROUTINE void _Message_queue_Free ( Message_queue_Control the_message_queue)

Deallocates a message queue control block into the inactive chain of free message queue control blocks.

This routine deallocates a message queue control block into the inactive chain of free message queue control blocks.

References _Objects_Free(), _Message_queue_Information, and Message_queue_Control::Object.

RTEMS_INLINE_ROUTINE Message_queue_Control* _Message_queue_Get ( Objects_Id  id,
Objects_Locations location 
)

Maps message queue IDs to message queue control blocks.

This function maps message queue IDs to message queue control blocks. If ID corresponds to a local message queue, then it returns the_message_queue control pointer which maps to ID and location is set to OBJECTS_LOCAL. If the message queue ID is global and resides on a remote node, then location is set to OBJECTS_REMOTE, and the_message_queue is undefined. Otherwise, location is set to OBJECTS_ERROR and the_message_queue is undefined.

References _Objects_Get(), and _Message_queue_Information.

RTEMS_INLINE_ROUTINE bool _Message_queue_Is_null ( Message_queue_Control the_message_queue)

Check whether message queue is null.

This function places the_message at the rear of the outstanding messages on the_message_queue.

void _Message_queue_Manager_initialization ( void  )

Message Queue Manager Initialization.

This routine performs the initialization necessary for this manager.

rtems_status_code _Message_queue_Submit ( rtems_id  id,
const void *  buffer,
size_t  size,
Message_queue_Submit_types  submit_type 
)

Message_queue_Submit.

This routine implements the directives rtems_message_queue_send and rtems_message_queue_urgent. It processes a message that is to be submitted to the designated message queue. The message will either be processed as a send send message which it will be inserted at the rear of the queue or it will be processed as an urgent message which will be inserted at the front of the queue.

rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( uint32_t  the_message_queue_status)

Message queue Translate Core Message Queue Return Code.

This function returns a RTEMS status code based on the_message_queue_status.

Parameters:
[in]the_message_queue_statusis the status code to translate
Return values:
translatedRTEMS status code
rtems_status_code rtems_message_queue_broadcast ( rtems_id  id,
const void *  buffer,
size_t  size,
uint32_t *  count 
)

RTEMS Broadcast Message Queue.

This routine implements the rtems_message_queue_broadcast directive. This directive sends the message buffer to all of the tasks blocked waiting for a message on the message queue indicated by ID. If no tasks are waiting, then the message buffer will not be queued.

Parameters:
[in]idis the pointer to message queue
[in]bufferis the pointer to message buffer
[in]sizeis the size of message to broadcast
[in]countpointer to area to store number of threads made ready
Return values:
RTEMS_SUCCESSFULif successful or error code if unsuccessful and *count filled in with number of threads made ready
rtems_status_code rtems_message_queue_create ( rtems_name  name,
uint32_t  count,
size_t  max_message_size,
rtems_attribute  attribute_set,
rtems_id id 
)

RTEMS Create Message Queue.

This routine implements the rtems_message_queue_create directive. The message queue will have the name. If the attribute_set indicates that the message queue is to be limited in the number of messages that can be outstanding, then count indicates the maximum number of messages that will be held. It returns the id of the created message queue in id.

Parameters:
[in]nameis the user defined queue name
[in]countis the maximum message and reserved buffer count
[in]max_message_sizeis the maximum size of each message
[in]attribute_setis the process method
[in]idis the pointer to queue
Return values:
Thismethod returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. If successful, the id will be filled in with the queue id.
rtems_status_code rtems_message_queue_delete ( rtems_id  id)

RTEMS Delete Message Queue.

This routine implements the rtems_message_queue_delete directive. The message queue indicated by ID is deleted.

Parameters:
[in]idis the queue id
Return values:
RTEMS_SUCCESSFULif successful or error code if unsuccessful
rtems_status_code rtems_message_queue_flush ( rtems_id  id,
uint32_t *  count 
)

rtems_message_queue_flush

This routine implements the rtems_message_queue_flush directive. This directive takes all outstanding messages for the message queue indicated by ID and returns them to the inactive message chain. The number of messages flushed is returned in COUNT.

Message Queue Manager

rtems_status_code rtems_message_queue_get_number_pending ( rtems_id  id,
uint32_t *  count 
)

RTEMS Message Queue Get Number Pending.

Message Queue Manager

This routine implements the rtems_message_queue_get_number_pending directive. This directive returns the number of pending messages for the message queue indicated by ID chain. The number of messages pending is returned in COUNT.

rtems_status_code rtems_message_queue_ident ( rtems_name  name,
uint32_t  node,
rtems_id id 
)

RTEMS Message Queue Name to Id.

This routine implements the rtems_message_queue_ident directive. This directive returns the message queue ID associated with NAME. If more than one message queue is named name, then the message queue to which the ID belongs is arbitrary. node indicates the extent of the search for the ID of the message queue named name. The search can be limited to a particular node or allowed to encompass all nodes.

Parameters:
[in]nameis the user defined message queue name
[in]nodeis the node(s) to be searched
[in]idis the pointer to message queue id
Return values:
RTEMS_SUCCESSFULif successful or error code if unsuccessful and *id filled with the message queue id
rtems_status_code rtems_message_queue_receive ( rtems_id  id,
void *  buffer,
size_t *  size,
rtems_option  option_set,
rtems_interval  timeout 
)

RTEMS Message Queue Receive.

This routine implements the rtems_message_queue_receive directive. This directive is invoked when the calling task wishes to receive a message from the message queue indicated by ID. The received message is to be placed in buffer. If no messages are outstanding and the option_set indicates that the task is willing to block, then the task will be blocked until a message arrives or until, optionally, timeout clock ticks have passed.

Parameters:
[in]idis the queue id
[in]bufferis the pointer to message buffer
[in]sizeis the size of message receive
[in]option_setis the options on receive
[in]timeoutis the number of ticks to wait
Return values:
Thismethod returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error.
rtems_status_code rtems_message_queue_send ( rtems_id  id,
const void *  buffer,
size_t  size 
)

rtems_message_queue_send

Message Queue Manager - rtems_message_queue_send

This routine implements the rtems_message_queue_send directive. This directive sends the message buffer to the message queue indicated by ID. If one or more tasks is blocked waiting to receive a message from this message queue, then one will receive the message. The task selected to receive the message is based on the task queue discipline algorithm in use by this particular message queue. If no tasks are waiting, then the message buffer will be placed at the REAR of the chain of pending messages for this message queue.

rtems_status_code rtems_message_queue_urgent ( rtems_id  id,
const void *  buffer,
size_t  size 
)

RTEMS Urgent Message Queue.

This routine implements the rtems_message_queue_urgent directive. This directive has the same behavior as rtems_message_queue_send except that if no tasks are waiting, the message buffer will be placed at the FRONT of the chain of pending messages rather than at the REAR.

Parameters:
[in]idis the pointer to message queue
[in]bufferis the pointer to message buffer
[in]sizeis the size of message to send urgently
Return values:
RTEMS_SUCCESSFULif successful or error code if unsuccessful