source: rtems/cpukit/rtems/include/rtems/rtems/messageimpl.h @ 641b44c2

5
Last change on this file since 641b44c2 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: 3.5 KB
Line 
1/**
2 * @file rtems/rtems/message.inl
3 *
4 *  This include file contains the static inline implementation of all
5 *  inlined routines in the Message Manager.
6 */
7
8/*  COPYRIGHT (c) 1989-2008.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#ifndef _RTEMS_RTEMS_MESSAGEIMPL_H
17#define _RTEMS_RTEMS_MESSAGEIMPL_H
18
19#include <rtems/rtems/message.h>
20#include <rtems/score/objectimpl.h>
21#include <rtems/score/coremsgimpl.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/**
28 *  @defgroup ClassicMessageQueueImpl Classic Message Queue Implementation
29 *
30 *  @ingroup ClassicMessageQueue
31 *
32 *  @{
33 */
34
35/**
36 *  The following enumerated type details the modes in which a message
37 *  may be submitted to a message queue.  The message may be posted
38 *  in a send or urgent fashion.
39 */
40typedef enum {
41  /**
42   *  This value indicates the user wants to send the message using the
43   *  normal message insertion protocol (FIFO or priority).
44   */
45  MESSAGE_QUEUE_SEND_REQUEST   = 0,
46  /**
47   *  This value indicates the user considers the message to be urgent
48   *  and wants it inserted at the head of the pending message queue.
49   */
50  MESSAGE_QUEUE_URGENT_REQUEST = 1
51}  Message_queue_Submit_types;
52
53/**
54 *  The following defines the information control block used to
55 *  manage this class of objects.
56 */
57extern Objects_Information _Message_queue_Information;
58
59/**
60 *  @brief Message_queue_Submit
61 *
62 *  This routine implements the directives rtems_message_queue_send
63 *  and rtems_message_queue_urgent.  It processes a message that is
64 *  to be submitted to the designated message queue.  The message will
65 *  either be processed as a send send message which it will be inserted
66 *  at the rear of the queue or it will be processed as an urgent message
67 *  which will be inserted at the front of the queue.
68 */
69rtems_status_code _Message_queue_Submit(
70  rtems_id                    id,
71  const void                 *buffer,
72  size_t                      size,
73  Message_queue_Submit_types  submit_type
74);
75
76/**
77 * @brief Message queue Translate Core Message Queue Return Code
78 *
79 * This function returns a RTEMS status code based on
80 * @a the_message_queue_status.
81 *
82 * @param[in] the_message_queue_status is the status code to translate
83 *
84 * @retval translated RTEMS status code
85 */
86rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
87  uint32_t   the_message_queue_status
88);
89
90/**
91 *  @brief Deallocates a message queue control block into
92 *  the inactive chain of free message queue control blocks.
93 *
94 *  This routine deallocates a message queue control block into
95 *  the inactive chain of free message queue control blocks.
96 */
97RTEMS_INLINE_ROUTINE void _Message_queue_Free (
98  Message_queue_Control *the_message_queue
99)
100{
101  _Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
102}
103
104RTEMS_INLINE_ROUTINE Message_queue_Control *
105_Message_queue_Get_interrupt_disable(
106  Objects_Id         id,
107  ISR_lock_Context  *lock_context
108)
109{
110  return (Message_queue_Control *) _Objects_Get_local(
111    id,
112    lock_context,
113    &_Message_queue_Information
114  );
115}
116
117RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Allocate( void )
118{
119  return (Message_queue_Control *)
120    _Objects_Allocate( &_Message_queue_Information );
121}
122
123/**@}*/
124
125#ifdef __cplusplus
126}
127#endif
128
129#if defined(RTEMS_MULTIPROCESSING)
130#include <rtems/rtems/msgmp.h>
131#endif
132
133#endif
134/* end of include file */
Note: See TracBrowser for help on using the repository browser.