RTEMS
msgqurgent.c
Go to the documentation of this file.
1 
8 /*
9  * COPYRIGHT (c) 1989-2014.
10  * On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
22 #include <rtems/rtems/statusimpl.h>
23 
25  rtems_id id,
26  const void *buffer,
27  size_t size
28 )
29 {
30  Message_queue_Control *the_message_queue;
31  Thread_queue_Context queue_context;
32  Status_Control status;
33 
34  if ( buffer == NULL ) {
35  return RTEMS_INVALID_ADDRESS;
36  }
37 
38  the_message_queue = _Message_queue_Get( id, &queue_context );
39 
40  if ( the_message_queue == NULL ) {
41 #if defined(RTEMS_MULTIPROCESSING)
42  return _Message_queue_MP_Urgent( id, buffer, size );
43 #else
44  return RTEMS_INVALID_ID;
45 #endif
46  }
47 
49  &the_message_queue->message_queue,
50  &queue_context
51  );
53  &queue_context,
54  _Message_queue_Core_message_queue_mp_support
55  );
57  &the_message_queue->message_queue,
58  buffer,
59  size,
60  false, /* sender does not block */
61  &queue_context
62  );
63  return _Status_Get( status );
64 }
Thread queue context for the thread queue methods.
Definition: threadq.h:198
Classic Message Queue Manager Implementation.
#define _Thread_queue_Context_set_MP_callout(queue_context, mp_callout)
Sets the MP callout in the thread queue context.
Definition: threadqimpl.h:456
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.
Definition: coremsgimpl.h:393
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
Classic Status Implementation.
CORE_message_queue_Control message_queue
Definition: messagedata.h:42
This status code indicates that a specified address was invalid.
Definition: status.h:133
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
rtems_status_code rtems_message_queue_urgent(rtems_id id, const void *buffer, size_t size)
%
Definition: msgqurgent.c:24
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.
Definition: coremsgimpl.h:432