📄 coremsg.h
字号:
* when it does not contain a pending message. */ Chain_Control Inactive_messages;} CORE_message_queue_Control;/** * @brief Initialize a Message Queue * * This routine initializes @a the_message_queue based on the parameters passed. * * @param[in] the_message_queue points to the message queue to initialize * @param[in] the_message_queue_attributes points to the attributes that * will be used with this message queue instance * @param[in] maximum_pending_messages is the maximum number of messages * that will be allowed to pend at any given time * @param[in] maximum_message_size is the size of largest message that * may be sent to this message queue instance * * @return TRUE if the message queue can be initialized. In general, * FALSE will only be returned if memory for the pending * messages cannot be allocated. */boolean _CORE_message_queue_Initialize( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, uint32_t maximum_message_size);/** * @brief Close a Message Queue * * This function closes a message by returning all allocated space and * flushing @a the_message_queue's task wait queue. * * @param[in] the_message_queue points to the message queue to close * @param[in] remote_extract_callout is the routine to call for each thread * that is extracted from the set of waiting threads * @param[in] status is the status that each waiting thread will return * from it's blocking service */void _CORE_message_queue_Close( CORE_message_queue_Control *the_message_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status);/** * @brief Flush Pending Messages * * This function flushes @a the_message_queue's pending message queue. The * number of messages flushed from the queue is returned. * * @param[in] the_message_queue points to the message queue to flush * * @return This method returns the number of message pending messages flushed. */uint32_t _CORE_message_queue_Flush( CORE_message_queue_Control *the_message_queue);/** * @brief Flush Messages Support Routine * * This routine flushes all outstanding messages and returns * them to the inactive message chain. * * @param[in] the_message_queue points to the message queue to flush * * @return This method returns the number of message pending messages flushed. */uint32_t _CORE_message_queue_Flush_support( CORE_message_queue_Control *the_message_queue);/** * @brief Flush Waiting Threads. * * This function flushes the threads which are blocked on * @a the_message_queue's pending message queue. They are * unblocked whether blocked sending or receiving. * * @param[in] the_message_queue points to the message queue to flush */void _CORE_message_queue_Flush_waiting_threads( CORE_message_queue_Control *the_message_queue);/** * @brief Broadcast a Message to the Message Queue * * This function sends a message for every thread waiting on the queue and * returns the number of threads made ready by the message. * * @param[in] the_message_queue points to the message queue * @param[in] buffer is the starting address of the message to broadcast * @param[in] size is the size of the message being broadcast * @param[in] id is the RTEMS object Id associated with this message queue. * It is used when unblocking a remote thread. * @param[in] api_message_queue_mp_support is the routine to invoke if * a thread that is unblocked is actually a remote thread. * @param[out] count points to the variable that will contain the * number of tasks that are sent this message * @return @a *count will contain the number of messages sent * @return indication of the successful completion or reason for failure */CORE_message_queue_Status _CORE_message_queue_Broadcast( CORE_message_queue_Control *the_message_queue, void *buffer, uint32_t size, Objects_Id id, CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, uint32_t *count);/** * @brief Submit a Message to the Message Queue * * This routine implements the send and urgent message functions. It * processes a message that is to be submitted to the designated * message queue. The message will either be processed as a * 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. * * @param[in] the_message_queue points to the message queue * @param[in] buffer is the starting address of the message to send * @param[in] size is the size of the message being send * @param[in] id is the RTEMS object Id associated with this message queue. * It is used when unblocking a remote thread. * @param[in] api_message_queue_mp_support is the routine to invoke if * a thread that is unblocked is actually a remote thread. * @param[in] submit_type determines whether the message is prepended, * appended, or enqueued in priority order. * @param[in] wait indicates whether the calling thread is willing to block * if the message queue is full. * @param[in] timeout is the maximum number of clock ticks that the calling * thread is willing to block if the message queue is full. * @return indication of the successful completion or reason for failure */CORE_message_queue_Status _CORE_message_queue_Submit( CORE_message_queue_Control *the_message_queue, void *buffer, uint32_t size, Objects_Id id, CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, CORE_message_queue_Submit_types submit_type, boolean wait, Watchdog_Interval timeout);/** * @brief Size a Message from the Message Queue * * This kernel routine dequeues a message, copies the message buffer to * a given destination buffer, and frees the message buffer to the * inactive message pool. The thread will be blocked if wait is TRUE, * otherwise an error will be given to the thread if no messages are available. * * @param[in] the_message_queue points to the message queue * @param[in] id is the RTEMS object Id associated with this message queue. * It is used when unblocking a remote thread. * @param[in] buffer is the starting address of the message buffer to * to be filled in with a message * @param[in] size is the size of the @a buffer and indicates the maximum * size message that the caller can receive. * @param[in] wait indicates whether the calling thread is willing to block * if the message queue is empty. * @param[in] timeout is the maximum number of clock ticks that the calling * thread is willing to block if the message queue is empty. * * @return indication of the successful completion or reason for failure * @note Returns message priority via return are in TCB. */void _CORE_message_queue_Seize( CORE_message_queue_Control *the_message_queue, Objects_Id id, void *buffer, uint32_t *size, boolean wait, Watchdog_Interval timeout);/** * This kernel routine inserts the specified message into the * message queue. It is assumed that the message has been filled * in before this routine is called. * * @param[in] the_message_queue points to the message queue * @param[in] the_message is the message to enqueue * @param[in] submit_type determines whether the message is prepended, * appended, or enqueued in priority order. */void _CORE_message_queue_Insert_message( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message, CORE_message_queue_Submit_types submit_type);#ifndef __RTEMS_APPLICATION__#include <rtems/score/coremsg.inl>#endif#ifdef __cplusplus}#endif/**@}*/#endif/* end of include file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -