source: rtems/cpukit/rtems/src/msgqurgent.c @ 52adc808

4.115
Last change on this file since 52adc808 was 52adc808, checked in by Alex Ivanov <alexivanov97@…>, on 12/02/12 at 16:03:09

score misc: Clean up Doxygen #12 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/8025203

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Urgent Message Queue
5 *  @ingroup ClassicMessageQueue
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
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.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/score/sysstate.h>
23#include <rtems/score/chain.h>
24#include <rtems/score/isr.h>
25#include <rtems/score/coremsg.h>
26#include <rtems/score/object.h>
27#include <rtems/score/states.h>
28#include <rtems/score/thread.h>
29#include <rtems/score/wkspace.h>
30#if defined(RTEMS_MULTIPROCESSING)
31#include <rtems/score/mpci.h>
32#endif
33#include <rtems/rtems/status.h>
34#include <rtems/rtems/attr.h>
35#include <rtems/rtems/message.h>
36#include <rtems/rtems/options.h>
37#include <rtems/rtems/support.h>
38
39#if defined(RTEMS_MULTIPROCESSING)
40#define MESSAGE_QUEUE_MP_HANDLER _Message_queue_Core_message_queue_mp_support
41#else
42#define MESSAGE_QUEUE_MP_HANDLER NULL
43#endif
44
45rtems_status_code rtems_message_queue_urgent(
46  rtems_id    id,
47  const void *buffer,
48  size_t      size
49)
50{
51  register Message_queue_Control  *the_message_queue;
52  Objects_Locations                location;
53  CORE_message_queue_Status        status;
54
55  if ( !buffer )
56    return RTEMS_INVALID_ADDRESS;
57
58  the_message_queue = _Message_queue_Get( id, &location );
59  switch ( location ) {
60
61    case OBJECTS_LOCAL:
62      status = _CORE_message_queue_Urgent(
63        &the_message_queue->message_queue,
64        buffer,
65        size,
66        id,
67        MESSAGE_QUEUE_MP_HANDLER,
68        false,   /* sender does not block */
69        0        /* no timeout */
70      );
71      _Thread_Enable_dispatch();
72
73      /*
74       *  Since this API does not allow for blocking sends, we can directly
75       *  return the returned status.
76       */
77
78      return _Message_queue_Translate_core_message_queue_return_code(status);
79
80#if defined(RTEMS_MULTIPROCESSING)
81    case OBJECTS_REMOTE:
82      return _Message_queue_MP_Send_request_packet(
83        MESSAGE_QUEUE_MP_URGENT_REQUEST,
84        id,
85        buffer,
86        &size,
87        0,                               /* option_set */
88        MPCI_DEFAULT_TIMEOUT
89      );
90#endif
91
92    case OBJECTS_ERROR:
93      break;
94  }
95
96  return RTEMS_INVALID_ID;
97}
Note: See TracBrowser for help on using the repository browser.