21 #ifndef _RTEMS_SCORE_COREMSGIMPL_H 22 #define _RTEMS_SCORE_COREMSGIMPL_H 25 #include <rtems/score/status.h> 49 #define CORE_MESSAGE_QUEUE_SEND_REQUEST INT_MAX 57 #define CORE_MESSAGE_QUEUE_URGENT_REQUEST INT_MIN 89 typedef void *( *CORE_message_queue_Allocate_buffers )(
148 uint32_t maximum_pending_messages,
149 size_t maximum_message_size,
193 #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) 206 void _CORE_message_queue_Flush_waiting_threads(
335 const void *content_source,
470 memcpy(destination, source, size);
527 #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) 554 #if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION) 570 return (the_message_queue->notify_handler != NULL);
583 #if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION) 586 CORE_message_queue_Notify_Handler the_handler
589 the_message_queue->notify_handler = the_handler;
593 #define _CORE_message_queue_Set_notify( the_message_queue, the_handler ) \ 642 if ( the_thread == NULL ) {
647 the_thread->
Wait.
count = (uint32_t) submit_type;
static __inline__ void _Thread_queue_Acquire_critical(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Acquires the thread queue control in a critical section.
static __inline__ CORE_message_queue_Buffer * _CORE_message_queue_Get_pending_message(CORE_message_queue_Control *the_message_queue)
Gets first message of message queue and removes it.
static __inline__ Thread_Control * _Thread_queue_First_locked(Thread_queue_Control *the_thread_queue, const Thread_queue_Operations *operations)
Returns the first thread on the thread queue if it exists, otherwise NULL.
Thread_Wait_information Wait
Thread queue context for the thread queue methods.
int CORE_message_queue_Submit_types
The modes in which a message may be submitted to a message queue.
void _CORE_message_queue_Close(CORE_message_queue_Control *the_message_queue, Thread_queue_Context *queue_context)
Closes a message queue.
Chain_Control Inactive_messages
static __inline__ void _CORE_message_queue_Free_message_buffer(CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer *the_message)
Frees a message buffer to inactive message buffer chain.
void _Thread_queue_Acquire(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Acquires the thread queue control in a critical section.
Constants and Structures Related with Thread Dispatch.
static __inline__ void _CORE_message_queue_Copy_buffer(const void *source, void *destination, size_t size)
Copies the source message buffer to the destination message buffer.
void *(* CORE_message_queue_Allocate_buffers)(CORE_message_queue_Control *the_message_queue, size_t size, const void *arg)
This handler shall allocate the message buffer storage area for a message queue.
static __inline__ Status_Control _CORE_message_queue_Urgent(CORE_message_queue_Control *the_message_queue, const void *buffer, size_t size, bool wait, Thread_queue_Context *queue_context)
Sends an urgent message to the message queue.
uint32_t _CORE_message_queue_Flush(CORE_message_queue_Control *the_message_queue, Thread_queue_Context *queue_context)
Flushes pending messages.
#define _CORE_message_queue_Set_notify(the_message_queue, the_handler)
Initializes notification information.
Status_Control _CORE_message_queue_Seize(CORE_message_queue_Control *the_message_queue, Thread_Control *executing, void *buffer, size_t *size_p, bool wait, Thread_queue_Context *queue_context)
Seizes a message from the message queue.
const Thread_queue_Operations * operations
The thread queue operations according to the blocking discipline.
uint32_t number_of_pending_messages
static __inline__ CORE_message_queue_Buffer * _CORE_message_queue_Allocate_message_buffer(CORE_message_queue_Control *the_message_queue)
Allocates a message buffer from the inactive message buffer chain.
Thread_queue_Queue Queue
The actual thread queue.
static __inline__ void _Chain_Append_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Appends a node (unprotected).
void _CORE_message_queue_Insert_message(CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer *the_message, const void *content_source, size_t content_size, CORE_message_queue_Submit_types submit_type)
Inserts a message into the message queue.
#define CORE_MESSAGE_QUEUE_SEND_REQUEST
Used when appending messages onto a message queue.
static __inline__ Thread_Control * _CORE_message_queue_Dequeue_receiver(CORE_message_queue_Control *the_message_queue, const void *buffer, size_t size, CORE_message_queue_Submit_types submit_type, Thread_queue_Context *queue_context)
Gets the first locked thread waiting to receive and dequeues it.
Constants and Structures Associated with the Manipulation of Objects.
static __inline__ int _CORE_message_queue_Get_message_priority(const CORE_message_queue_Buffer *the_message)
Gets message priority.
Chain_Control Pending_messages
#define CORE_MESSAGE_QUEUE_URGENT_REQUEST
Used when prepending messages onto a message queue.
The structure is used to organize message buffers of a message queue.
CORE_message_queue_Disciplines
The possible blocking disciplines for a message queue.
Status_Control _CORE_message_queue_Initialize(CORE_message_queue_Control *the_message_queue, CORE_message_queue_Disciplines discipline, uint32_t maximum_pending_messages, size_t maximum_message_size, CORE_message_queue_Allocate_buffers allocate_buffers, const void *arg)
Initializes a message queue.
static __inline__ Status_Control _CORE_message_queue_Send(CORE_message_queue_Control *the_message_queue, const void *buffer, size_t size, bool wait, Thread_queue_Context *queue_context)
Sends a message to the message queue.
Status_Control _CORE_message_queue_Broadcast(CORE_message_queue_Control *the_message_queue, const void *buffer, size_t size, uint32_t *count, Thread_queue_Context *queue_context)
Broadcasts a message to the message queue.
int priority
This member defines the priority of this message.
Constants and Structures Associated with the Message Queue Handler.
Control block used to manage each message queue.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
Status_Control _CORE_message_queue_Submit(CORE_message_queue_Control *the_message_queue, Thread_Control *executing, const void *buffer, size_t size, CORE_message_queue_Submit_types submit_type, bool wait, Thread_queue_Context *queue_context)
Submits a message to the message queue.
void _Thread_queue_Release(Thread_queue_Control *the_thread_queue, Thread_queue_Context *queue_context)
Releases the thread queue control and enables interrupts.
static __inline__ void _CORE_message_queue_Release(CORE_message_queue_Control *the_message_queue, Thread_queue_Context *queue_context)
Releases the message queue.
void _Thread_queue_Extract_critical(Thread_queue_Queue *queue, const Thread_queue_Operations *operations, Thread_Control *the_thread, Thread_queue_Context *queue_context)
Extracts the thread from the thread queue and unblocks it.
void * _CORE_message_queue_Workspace_allocate(CORE_message_queue_Control *the_message_queue, size_t size, const void *arg)
This handler allocates the message buffer storage area for a message queue from the RTEMS Workspace...
Chain_Node Node
This member is used to enqueue the buffer in the pending or free buffer queue of a message queue...
Thread_queue_Control Wait_queue
static __inline__ void _CORE_message_queue_Acquire_critical(CORE_message_queue_Control *the_message_queue, Thread_queue_Context *queue_context)
Acquires the message queue critical.
static __inline__ Chain_Node * _Chain_Get_unprotected(Chain_Control *the_chain)
Gets the first node (unprotected).
static __inline__ void _CORE_message_queue_Acquire(CORE_message_queue_Control *the_message_queue, Thread_queue_Context *queue_context)
Acquires the message queue.