source: rtems/cpukit/rtems/src/msgqbroadcast.c @ 7af4d67

Last change on this file since 7af4d67 was 7af4d67, checked in by Sebastian Huber <sebastian.huber@…>, on May 24, 2016 at 10:00:32 AM

mpci: Add missing return statements

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Broadcast Message Queue
5 *  @ingroup ClassicMessageQueue
6 */
7
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#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/messageimpl.h>
22
23rtems_status_code rtems_message_queue_broadcast(
24  rtems_id    id,
25  const void *buffer,
26  size_t      size,
27  uint32_t   *count
28)
29{
30  Message_queue_Control     *the_message_queue;
31  ISR_lock_Context           lock_context;
32  CORE_message_queue_Status  status;
33
34  if ( buffer == NULL ) {
35    return RTEMS_INVALID_ADDRESS;
36  }
37
38  if ( count == NULL ) {
39    return RTEMS_INVALID_ADDRESS;
40  }
41
42  the_message_queue = _Message_queue_Get( id, &lock_context );
43
44  if ( the_message_queue == NULL ) {
45#if defined(RTEMS_MULTIPROCESSING)
46    return _Message_queue_MP_Broadcast( id, buffer, size, count );
47#else
48    return RTEMS_INVALID_ID;
49#endif
50  }
51
52  status = _CORE_message_queue_Broadcast(
53    &the_message_queue->message_queue,
54    buffer,
55    size,
56    _Message_queue_Core_message_queue_mp_support,
57    id,
58    count,
59    &lock_context
60  );
61  return _Message_queue_Translate_core_message_queue_return_code( status );
62}
Note: See TracBrowser for help on using the repository browser.