RTEMS
msgqbroadcast.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  uint32_t *count
29 )
30 {
31  Message_queue_Control *the_message_queue;
32  Thread_queue_Context queue_context;
33  Status_Control status;
34 
35  if ( buffer == NULL ) {
36  return RTEMS_INVALID_ADDRESS;
37  }
38 
39  if ( count == NULL ) {
40  return RTEMS_INVALID_ADDRESS;
41  }
42 
43  the_message_queue = _Message_queue_Get( id, &queue_context );
44 
45  if ( the_message_queue == NULL ) {
46 #if defined(RTEMS_MULTIPROCESSING)
47  return _Message_queue_MP_Broadcast( id, buffer, size, count );
48 #else
49  return RTEMS_INVALID_ID;
50 #endif
51  }
52 
54  &queue_context,
55  _Message_queue_Core_message_queue_mp_support
56  );
58  &the_message_queue->message_queue,
59  buffer,
60  size,
61  count,
62  &queue_context
63  );
64  return _Status_Get( status );
65 }
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
rtems_status_code rtems_message_queue_broadcast(rtems_id id, const void *buffer, size_t size, uint32_t *count)
%
Definition: msgqbroadcast.c:24
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
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.