source: rtems/cpukit/rtems/src/msgqurgent.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 *  Message Queue Manager - rtems_message_queue_urgent
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <rtems/system.h>
17#include <rtems/score/sysstate.h>
18#include <rtems/score/chain.h>
19#include <rtems/score/isr.h>
20#include <rtems/score/coremsg.h>
21#include <rtems/score/object.h>
22#include <rtems/score/states.h>
23#include <rtems/score/thread.h>
24#include <rtems/score/wkspace.h>
25#if defined(RTEMS_MULTIPROCESSING)
26#include <rtems/score/mpci.h>
27#endif
28#include <rtems/rtems/status.h>
29#include <rtems/rtems/attr.h>
30#include <rtems/rtems/message.h>
31#include <rtems/rtems/options.h>
32#include <rtems/rtems/support.h>
33
34/*
35 *  rtems_message_queue_urgent
36 *
37 *  This routine implements the directives rtems_message_queue_urgent.  It
38 *  prepends a message to the specified message queue.
39 *
40 *  Input parameters:
41 *    id     - pointer to message queue
42 *    buffer - pointer to message buffer
43 *    size   - size of message to send urgently
44 *
45 *  Output parameters:
46 *    RTEMS_SUCCESSFUL - if successful
47 *    error code       - if unsuccessful
48 */
49
50#if defined(RTEMS_MULTIPROCESSING)
51#define MESSAGE_QUEUE_MP_HANDLER _Message_queue_Core_message_queue_mp_support
52#else
53#define MESSAGE_QUEUE_MP_HANDLER NULL
54#endif
55
56rtems_status_code rtems_message_queue_urgent(
57  rtems_id    id,
58  const void *buffer,
59  size_t      size
60)
61{
62  register Message_queue_Control  *the_message_queue;
63  Objects_Locations                location;
64  CORE_message_queue_Status        status;
65
66  if ( !buffer )
67    return RTEMS_INVALID_ADDRESS;
68
69  the_message_queue = _Message_queue_Get( id, &location );
70  switch ( location ) {
71
72    case OBJECTS_LOCAL:
73      status = _CORE_message_queue_Urgent(
74        &the_message_queue->message_queue,
75        buffer,
76        size,
77        id,
78        MESSAGE_QUEUE_MP_HANDLER,
79        false,   /* sender does not block */
80        0        /* no timeout */
81      );
82      _Thread_Enable_dispatch();
83
84      /*
85       *  Since this API does not allow for blocking sends, we can directly
86       *  return the returned status.
87       */
88
89      return _Message_queue_Translate_core_message_queue_return_code(status);
90
91#if defined(RTEMS_MULTIPROCESSING)
92    case OBJECTS_REMOTE:
93      return _Message_queue_MP_Send_request_packet(
94        MESSAGE_QUEUE_MP_URGENT_REQUEST,
95        id,
96        buffer,
97        &size,
98        0,                               /* option_set */
99        MPCI_DEFAULT_TIMEOUT
100      );
101#endif
102
103    case OBJECTS_ERROR:
104      break;
105  }
106
107  return RTEMS_INVALID_ID;
108}
Note: See TracBrowser for help on using the repository browser.