Defines the interfaces and data structures for the API sub-component MSGQ.
============================================================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ============================================================================
#include <dsplink.h>
#include <msgqdefs.h>
Go to the source code of this file.
Defines | |
#define | MSGQ_getMsgId(msg) (((MSGQ_Msg) (msg))->msgId) |
This macro returns the message ID of the specified message. ============================================================================. | |
#define | MSGQ_getMsgSize(msg) (((MSGQ_Msg) (msg))->size) |
This macro returns the size of the specified message. ============================================================================. | |
#define | MSGQ_setMsgId(msg, id) ((MSGQ_Msg) (msg))->msgId = id |
This macro sets the message ID in the specified message. ============================================================================. | |
#define | MSGQ_getDstQueue(msg) ((Uint32) ID_GPP << 16u) | ((MSGQ_Msg) (msg))->dstId |
This macro returns the MSGQ_Queue handle of the destination message queue for the specified message. ============================================================================. | |
#define | MSGQ_setSrcQueue(msg, msgq) |
This macro sets the source message queue in the specified message. ============================================================================. | |
#define | MSGQ_isLocalQueue(msgq) ((msgq >> 16u) == ID_GPP) |
This macro checks whether the specified queue is a local queue. ============================================================================. | |
#define | MSGQ_GetMsgId MSGQ_getMsgId |
#define | MSGQ_GetMsgSize MSGQ_getMsgSize |
#define | MSGQ_SetMsgId MSGQ_setMsgId |
#define | MSGQ_GetDstQueue MSGQ_getDstQueue |
#define | MSGQ_SetSrcQueue MSGQ_setSrcQueue |
#define | MSGQ_IsLocalQueue MSGQ_isLocalQueue |
#define | MSGQ_TransportOpen MSGQ_transportOpen |
#define | MSGQ_TransportClose MSGQ_transportClose |
#define | MSGQ_Open MSGQ_open |
#define | MSGQ_Close MSGQ_close |
#define | MSGQ_Locate MSGQ_locate |
#define | MSGQ_LocateAsync MSGQ_locateAsync |
#define | MSGQ_Release MSGQ_release |
#define | MSGQ_Alloc MSGQ_alloc |
#define | MSGQ_Free MSGQ_free |
#define | MSGQ_Put MSGQ_put |
#define | MSGQ_Get MSGQ_get |
#define | MSGQ_GetSrcQueue MSGQ_getSrcQueue |
#define | MSGQ_Count MSGQ_count |
#define | MSGQ_SetErrorHandler MSGQ_setErrorHandler |
Functions | |
DLLEXPORT DSP_STATUS | MSGQ_transportOpen (IN ProcessorId procId, IN Pvoid attrs) |
This function initializes the transport associated with the specified processor. The transport corresponding to the processor ID specified in the call should be configured in the CFG. This function should be called only once as part of system initialization after the client has called PROC_Attach the first time. Subsequent tasks / threads should not call this function again as it would result in unpredictable behavior. | |
DLLEXPORT DSP_STATUS | MSGQ_transportClose (IN ProcessorId procId) |
This function finalizes the transport associated with the specified processor. | |
DLLEXPORT DSP_STATUS | MSGQ_open (IN Pstr queueName, OUT MSGQ_Queue *msgqQueue, IN MSGQ_Attrs *attrs) |
This function opens the message queue to be used for receiving messages, identified through the specified message queue name. | |
DLLEXPORT DSP_STATUS | MSGQ_close (IN MSGQ_Queue msgqQueue) |
This function closes the message queue identified by the specified MSGQ handle. | |
DLLEXPORT DSP_STATUS | MSGQ_locate (IN Pstr queueName, OUT MSGQ_Queue *msgqQueue, IN MSGQ_LocateAttrs *attrs) |
This function synchronously locates the message queue identified by the specified MSGQ name and returns a handle to the located message queue. | |
DLLEXPORT DSP_STATUS | MSGQ_locateAsync (IN Pstr queueName, IN MSGQ_Queue replyQueue, IN MSGQ_LocateAsyncAttrs *attrs) |
This function asynchronously locates the message queue identified by the specified MSGQ name. An attempt is made to asynchronously locate the message queue. If found, an MSGQ_AsyncLocateMsg message is sent to the specified reply message queue. | |
DLLEXPORT DSP_STATUS | MSGQ_release (IN MSGQ_Queue msgqQueue) |
This function releases the message queue identified by the MSGQ handle that was located earlier. | |
DLLEXPORT DSP_STATUS | MSGQ_alloc (IN PoolId poolId, IN Uint16 size, OUT MSGQ_Msg *msg) |
This function allocates a message, and returns the pointer to the user. | |
DLLEXPORT DSP_STATUS | MSGQ_free (IN MSGQ_Msg msg) |
This function frees a message. | |
DLLEXPORT DSP_STATUS | MSGQ_put (IN MSGQ_Queue msgqQueue, IN MSGQ_Msg msg) |
This function sends a message to the specified MSGQ. | |
DLLEXPORT DSP_STATUS | MSGQ_get (IN MSGQ_Queue msgqQueue, IN Uint32 timeout, OUT MSGQ_Msg *msg) |
This function receives a message on the specified MSGQ. | |
DLLEXPORT DSP_STATUS | MSGQ_getSrcQueue (IN MSGQ_Msg msg, OUT MSGQ_Queue *msgqQueue) |
This function returns a handle to the source message queue of a message to be used for replying to the message. | |
DLLEXPORT DSP_STATUS | MSGQ_count (IN MSGQ_Queue msgqQueue, OUT Uint16 *count) |
This API returns the count of the number of messages in a local message queue. | |
DLLEXPORT DSP_STATUS | MSGQ_setErrorHandler (IN MSGQ_Queue errorQueue, IN PoolId poolId) |
This API allows the user to designate a MSGQ as an error-handler MSGQ to receive asynchronous error messages from the transports. |
#define MSGQ_getMsgId | ( | msg ) | (((MSGQ_Msg) (msg))->msgId) |
This macro returns the message ID of the specified message. ============================================================================.
============================================================================
#define MSGQ_getMsgSize | ( | msg ) | (((MSGQ_Msg) (msg))->size) |
This macro returns the size of the specified message. ============================================================================.
============================================================================
#define MSGQ_setMsgId | ( | msg, | |
id | |||
) | ((MSGQ_Msg) (msg))->msgId = id |
This macro sets the message ID in the specified message. ============================================================================.
============================================================================
#define MSGQ_getDstQueue | ( | msg ) | ((Uint32) ID_GPP << 16u) | ((MSGQ_Msg) (msg))->dstId |
This macro returns the MSGQ_Queue handle of the destination message queue for the specified message. ============================================================================.
============================================================================
#define MSGQ_setSrcQueue | ( | msg, | |
msgq | |||
) |
((MSGQ_Msg) (msg))->srcId = (MSGQ_Id) msgq ; \ ((MSGQ_Msg) (msg))->srcProcId = (Uint16) \ (msgq >> 16u)
This macro sets the source message queue in the specified message. ============================================================================.
============================================================================
#define MSGQ_isLocalQueue | ( | msgq ) | ((msgq >> 16u) == ID_GPP) |
This macro checks whether the specified queue is a local queue. ============================================================================.
============================================================================
#define MSGQ_GetMsgId MSGQ_getMsgId |
============================================================================
============================================================================
#define MSGQ_GetMsgSize MSGQ_getMsgSize |
============================================================================
============================================================================
#define MSGQ_SetMsgId MSGQ_setMsgId |
============================================================================
============================================================================
#define MSGQ_GetDstQueue MSGQ_getDstQueue |
============================================================================
============================================================================
#define MSGQ_SetSrcQueue MSGQ_setSrcQueue |
============================================================================
============================================================================
#define MSGQ_IsLocalQueue MSGQ_isLocalQueue |
============================================================================
============================================================================
#define MSGQ_TransportOpen MSGQ_transportOpen |
============================================================================
============================================================================
#define MSGQ_TransportClose MSGQ_transportClose |
============================================================================
============================================================================
#define MSGQ_Open MSGQ_open |
============================================================================
============================================================================
#define MSGQ_Close MSGQ_close |
============================================================================
============================================================================
#define MSGQ_Locate MSGQ_locate |
============================================================================
============================================================================
#define MSGQ_LocateAsync MSGQ_locateAsync |
============================================================================
============================================================================
#define MSGQ_Release MSGQ_release |
============================================================================
============================================================================
#define MSGQ_Alloc MSGQ_alloc |
============================================================================
============================================================================
#define MSGQ_Free MSGQ_free |
============================================================================
============================================================================
#define MSGQ_Put MSGQ_put |
============================================================================
============================================================================
#define MSGQ_Get MSGQ_get |
============================================================================
============================================================================
#define MSGQ_GetSrcQueue MSGQ_getSrcQueue |
============================================================================
============================================================================
#define MSGQ_Count MSGQ_count |
============================================================================
============================================================================
#define MSGQ_SetErrorHandler MSGQ_setErrorHandler |
============================================================================
============================================================================
DLLEXPORT DSP_STATUS MSGQ_transportOpen | ( | IN ProcessorId | procId, |
IN Pvoid | attrs | ||
) |
This function initializes the transport associated with the specified processor. The transport corresponding to the processor ID specified in the call should be configured in the CFG. This function should be called only once as part of system initialization after the client has called PROC_Attach the first time. Subsequent tasks / threads should not call this function again as it would result in unpredictable behavior.
============================================================================
procId | ID of the Processor for which the transport is to be opened. |
attrs | Attributes for initialization of the transport. The structure of the expected attributes is specific to a transport. |
DLLEXPORT DSP_STATUS MSGQ_transportClose | ( | IN ProcessorId | procId ) |
This function finalizes the transport associated with the specified processor.
============================================================================
procId | ID of the Processor for which the transport is to be closed. |
DLLEXPORT DSP_STATUS MSGQ_open | ( | IN Pstr | queueName, |
OUT MSGQ_Queue * | msgqQueue, | ||
IN MSGQ_Attrs * | attrs | ||
) |
This function opens the message queue to be used for receiving messages, identified through the specified message queue name.
============================================================================
queueName | Name of the message queue to be opened. |
msgqQueue | Location to store the handle to the message queue. |
attrs | Optional attributes for creation of the MSGQ. |
DLLEXPORT DSP_STATUS MSGQ_close | ( | IN MSGQ_Queue | msgqQueue ) |
This function closes the message queue identified by the specified MSGQ handle.
============================================================================
msgqQueue | Handle to the message queue to be closed. |
DLLEXPORT DSP_STATUS MSGQ_locate | ( | IN Pstr | queueName, |
OUT MSGQ_Queue * | msgqQueue, | ||
IN MSGQ_LocateAttrs * | attrs | ||
) |
This function synchronously locates the message queue identified by the specified MSGQ name and returns a handle to the located message queue.
============================================================================
queueName | Name of the message queue to be located. |
msgqQueue | Location to store the handle to the located message queue. |
attrs | Optional attributes for location of the MSGQ. |
DLLEXPORT DSP_STATUS MSGQ_locateAsync | ( | IN Pstr | queueName, |
IN MSGQ_Queue | replyQueue, | ||
IN MSGQ_LocateAsyncAttrs * | attrs | ||
) |
This function asynchronously locates the message queue identified by the specified MSGQ name. An attempt is made to asynchronously locate the message queue. If found, an MSGQ_AsyncLocateMsg message is sent to the specified reply message queue.
============================================================================
queueName | Name of the message queue to be located. |
replyQueue | Message queue to be used to receive the response message for asynchronous location. |
attrs | Attributes for asynchronous location of the MSGQ. |
DLLEXPORT DSP_STATUS MSGQ_release | ( | IN MSGQ_Queue | msgqQueue ) |
This function releases the message queue identified by the MSGQ handle that was located earlier.
============================================================================
msgqQueue | Handle to the message queue to be released. |
DLLEXPORT DSP_STATUS MSGQ_alloc | ( | IN PoolId | poolId, |
IN Uint16 | size, | ||
OUT MSGQ_Msg * | msg | ||
) |
This function allocates a message, and returns the pointer to the user.
============================================================================
poolId | ID of the Pool to be used for allocating this message. |
size | Size of the message to be allocated. |
msg | Location to receive the allocated message. |
DLLEXPORT DSP_STATUS MSGQ_free | ( | IN MSGQ_Msg | msg ) |
This function frees a message.
============================================================================
msg | Pointer to the message to be freed. |
DLLEXPORT DSP_STATUS MSGQ_put | ( | IN MSGQ_Queue | msgqQueue, |
IN MSGQ_Msg | msg | ||
) |
This function sends a message to the specified MSGQ.
============================================================================
msgqQueue | Handle to the destination MSGQ. |
msg | Pointer to the message to be sent to the destination MSGQ. |
DLLEXPORT DSP_STATUS MSGQ_get | ( | IN MSGQ_Queue | msgqQueue, |
IN Uint32 | timeout, | ||
OUT MSGQ_Msg * | msg | ||
) |
This function receives a message on the specified MSGQ.
============================================================================
msgqQueue | Handle to the MSGQ on which the message is to be received. |
timeout | Timeout value to wait for the message (in milliseconds). |
msg | Location to receive the message. |
DLLEXPORT DSP_STATUS MSGQ_getSrcQueue | ( | IN MSGQ_Msg | msg, |
OUT MSGQ_Queue * | msgqQueue | ||
) |
This function returns a handle to the source message queue of a message to be used for replying to the message.
============================================================================
msg | Message, whose source MSGQ handle is to be returned. |
msgqQueue | Location to retrieve the handle to the source MSGQ. |
DLLEXPORT DSP_STATUS MSGQ_count | ( | IN MSGQ_Queue | msgqQueue, |
OUT Uint16 * | count | ||
) |
This API returns the count of the number of messages in a local message queue.
============================================================================
msgqQueue | Handle to the MSGQ for which the count is to be retrieved. |
count | Location to receive the message count. |
DLLEXPORT DSP_STATUS MSGQ_setErrorHandler | ( | IN MSGQ_Queue | errorQueue, |
IN PoolId | poolId | ||
) |
This API allows the user to designate a MSGQ as an error-handler MSGQ to receive asynchronous error messages from the transports.
============================================================================
errorQueue | Handle to the message queue to receive the error messages. |
poolId | ID indicating the pool to be used for allocating the error messages. |