source: rtems-docs/c-user/config/msg-queue-buffer.rst @ 1af97ad

5
Last change on this file since 1af97ad was 4d74cbd, checked in by Sebastian Huber <sebastian.huber@…>, on 03/09/20 at 07:50:59

c-user: Move "Message Queue Buffer Configuration"

Update #3836.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1.. SPDX-License-Identifier: CC-BY-SA-4.0
2
3.. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
4
5Message Queue Buffer Configuration
6==================================
7
8This section describes the configuration parameters related to specifying the
9amount of memory reserved for message queue message buffers.  See
10:ref:`CONFIGURE_MAXIMUM_MESSAGE_QUEUES` and
11:ref:`CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES`.
12
13.. index:: CONFIGURE_MESSAGE_BUFFER_MEMORY
14.. index:: configure message queue buffer memory
15
16.. _CONFIGURE_MESSAGE_BUFFER_MEMORY:
17
18CONFIGURE_MESSAGE_BUFFER_MEMORY
19-------------------------------
20
21CONSTANT:
22    ``CONFIGURE_MESSAGE_BUFFER_MEMORY``
23
24DATA TYPE:
25    integer summation macro
26
27RANGE:
28    undefined (zero) or calculation resulting in a positive integer
29
30DEFAULT VALUE:
31    This is not defined by default, and zero (0) memory is reserved.
32
33DESCRIPTION:
34    This macro is set to the number of bytes the application requires to be
35    reserved for pending Classic API Message Queue buffers.
36
37NOTES:
38    The following illustrates how the help macro
39    :ref:`CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE` can be used to assist in
40    calculating the message buffer memory required.  In this example, there are
41    two message queues used in this application.  The first message queue has
42    maximum of 24 pending messages with the message structure defined by the
43    type ``one_message_type``.  The other message queue has maximum of 500
44    pending messages with the message structure defined by the type
45    ``other_message_type``.
46
47    .. code-block:: c
48
49        #define CONFIGURE_MESSAGE_BUFFER_MEMORY \
50                    (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
51                         24, sizeof(one_message_type) \
52                     ) + \
53                     CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
54                         500, sizeof(other_message_type) \
55                     )
56
57.. index:: CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE
58.. index:: memory for a single message queue's buffers
59
60.. _CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE:
61
62CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE
63-----------------------------------
64
65CONSTANT:
66    ``CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(max_messages, size_per)``
67
68DATA TYPE:
69    Unsigned integer (``size_t``).
70
71RANGE:
72    Positive.
73
74DEFAULT VALUE:
75    The default value is None.
76
77DESCRIPTION:
78    This is a helper macro which is used to assist in computing the total
79    amount of memory required for message buffers.  Each message queue will
80    have its own configuration with maximum message size and maximum number of
81    pending messages.
82
83    The interface for this macro is as follows:
84
85    .. code-block:: c
86
87        CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(max_messages, size_per)
88
89    Where ``max_messages`` is the maximum number of pending messages and
90    ``size_per`` is the size in bytes of the user message.
91
92NOTES:
93    This macro is only used in support of :ref:`CONFIGURE_MESSAGE_BUFFER_MEMORY`.
Note: See TracBrowser for help on using the repository browser.