source: rtems/cpukit/include/rtems/rtems/messageimpl.h @ 21275b58

Last change on this file since 21275b58 was 21275b58, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 22, 2018 at 6:14:51 PM

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ClassicMessageQueueImpl
5 *
6 * @brief Classic Message Queue Manager Implementation
7 */
8
9/*  COPYRIGHT (c) 1989-2008.
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#ifndef _RTEMS_RTEMS_MESSAGEIMPL_H
18#define _RTEMS_RTEMS_MESSAGEIMPL_H
19
20#include <rtems/rtems/messagedata.h>
21#include <rtems/score/objectimpl.h>
22#include <rtems/score/coremsgimpl.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/**
29 *  @defgroup ClassicMessageQueueImpl Classic Message Queue Implementation
30 *
31 *  @ingroup ClassicMessageQueue
32 *
33 *  @{
34 */
35
36/**
37 *  The following enumerated type details the modes in which a message
38 *  may be submitted to a message queue.  The message may be posted
39 *  in a send or urgent fashion.
40 */
41typedef enum {
42  /**
43   *  This value indicates the user wants to send the message using the
44   *  normal message insertion protocol (FIFO or priority).
45   */
46  MESSAGE_QUEUE_SEND_REQUEST   = 0,
47  /**
48   *  This value indicates the user considers the message to be urgent
49   *  and wants it inserted at the head of the pending message queue.
50   */
51  MESSAGE_QUEUE_URGENT_REQUEST = 1
52}  Message_queue_Submit_types;
53
54/**
55 *  @brief Message_queue_Submit
56 *
57 *  This routine implements the directives rtems_message_queue_send
58 *  and rtems_message_queue_urgent.  It processes a message that is
59 *  to be submitted to the designated message queue.  The message will
60 *  either be processed as a send send message which it will be inserted
61 *  at the rear of the queue or it will be processed as an urgent message
62 *  which will be inserted at the front of the queue.
63 */
64rtems_status_code _Message_queue_Submit(
65  rtems_id                    id,
66  const void                 *buffer,
67  size_t                      size,
68  Message_queue_Submit_types  submit_type
69);
70
71/**
72 *  @brief Deallocates a message queue control block into
73 *  the inactive chain of free message queue control blocks.
74 *
75 *  This routine deallocates a message queue control block into
76 *  the inactive chain of free message queue control blocks.
77 */
78RTEMS_INLINE_ROUTINE void _Message_queue_Free (
79  Message_queue_Control *the_message_queue
80)
81{
82  _Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
83}
84
85RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get(
86  Objects_Id            id,
87  Thread_queue_Context *queue_context
88)
89{
90  _Thread_queue_Context_initialize( queue_context );
91  return (Message_queue_Control *) _Objects_Get(
92    id,
93    &queue_context->Lock_context.Lock_context,
94    &_Message_queue_Information
95  );
96}
97
98RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Allocate( void )
99{
100  return (Message_queue_Control *)
101    _Objects_Allocate( &_Message_queue_Information );
102}
103
104/**@}*/
105
106#ifdef __cplusplus
107}
108#endif
109
110#if defined(RTEMS_MULTIPROCESSING)
111#include <rtems/rtems/msgmp.h>
112#endif
113
114#endif
115/* end of include file */
Note: See TracBrowser for help on using the repository browser.