source: rtems/cpukit/rtems/src/msgqbroadcast.c @ 62c528e6

5
Last change on this file since 62c528e6 was 641b44c2, checked in by Sebastian Huber <sebastian.huber@…>, on 05/20/16 at 12:21:12

rtems: _Message_queue_Get_interrupt_disable()

Use _Objects_Get_local() for _Message_queue_Get_interrupt_disable() to
get rid of the location parameter. Move remote object handling to
message queue MPCI support.

  • 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_interrupt_disable(
43    id,
44    &lock_context
45  );
46
47  if ( the_message_queue == NULL ) {
48#if defined(RTEMS_MULTIPROCESSING)
49    _Message_queue_MP_Broadcast( id, buffer, size, count );
50#else
51    return RTEMS_INVALID_ID;
52#endif
53  }
54
55  status = _CORE_message_queue_Broadcast(
56    &the_message_queue->message_queue,
57    buffer,
58    size,
59    _Message_queue_Core_message_queue_mp_support,
60    id,
61    count,
62    &lock_context
63  );
64  return _Message_queue_Translate_core_message_queue_return_code( status );
65}
Note: See TracBrowser for help on using the repository browser.