[e52906b] | 1 | .. SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
[489740f] | 2 | |
---|
[63a9e0c] | 3 | .. Copyright (C) 2020, 2021 embedded brains GmbH (http://www.embedded-brains.de) |
---|
[4886d60] | 4 | .. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) |
---|
[8ef6ea8] | 5 | |
---|
[63a9e0c] | 6 | .. This file is part of the RTEMS quality process and was automatically |
---|
| 7 | .. generated. If you find something that needs to be fixed or |
---|
| 8 | .. worded better please post a report or patch to an RTEMS mailing list |
---|
| 9 | .. or raise a bug report: |
---|
| 10 | .. |
---|
| 11 | .. https://www.rtems.org/bugs.html |
---|
| 12 | .. |
---|
| 13 | .. For information on updating and regenerating please refer to the How-To |
---|
| 14 | .. section in the Software Requirements Engineering chapter of the |
---|
| 15 | .. RTEMS Software Engineering manual. The manual is provided as a part of |
---|
| 16 | .. a release. For development sources please refer to the online |
---|
| 17 | .. documentation at: |
---|
| 18 | .. |
---|
| 19 | .. https://docs.rtems.org |
---|
| 20 | |
---|
| 21 | .. _MessageManagerDirectives: |
---|
| 22 | |
---|
[fd6dc8c8] | 23 | Directives |
---|
| 24 | ========== |
---|
| 25 | |
---|
[63a9e0c] | 26 | This section details the directives of the Message Manager. A subsection is |
---|
| 27 | dedicated to each of this manager's directives and lists the calling sequence, |
---|
| 28 | parameters, description, return values, and notes of the directive. |
---|
| 29 | |
---|
| 30 | .. Generated from spec:/rtems/message/if/create |
---|
[8ef6ea8] | 31 | |
---|
[53bb72e] | 32 | .. raw:: latex |
---|
| 33 | |
---|
[63a9e0c] | 34 | \clearpage |
---|
[53bb72e] | 35 | |
---|
[63a9e0c] | 36 | .. index:: rtems_message_queue_create() |
---|
[6c56401] | 37 | .. index:: create a message queue |
---|
[63a9e0c] | 38 | |
---|
| 39 | .. _InterfaceRtemsMessageQueueCreate: |
---|
| 40 | |
---|
| 41 | rtems_message_queue_create() |
---|
| 42 | ---------------------------- |
---|
| 43 | |
---|
| 44 | Creates a message queue. |
---|
| 45 | |
---|
| 46 | .. rubric:: CALLING SEQUENCE: |
---|
| 47 | |
---|
| 48 | .. code-block:: c |
---|
| 49 | |
---|
| 50 | rtems_status_code rtems_message_queue_create( |
---|
| 51 | rtems_name name, |
---|
| 52 | uint32_t count, |
---|
| 53 | size_t max_message_size, |
---|
| 54 | rtems_attribute attribute_set, |
---|
| 55 | rtems_id *id |
---|
| 56 | ); |
---|
| 57 | |
---|
| 58 | .. rubric:: PARAMETERS: |
---|
| 59 | |
---|
| 60 | ``name`` |
---|
| 61 | This parameter is the object name of the message queue. |
---|
| 62 | |
---|
| 63 | ``count`` |
---|
| 64 | This parameter is the maximum count of pending messages supported by the |
---|
| 65 | message queue. |
---|
| 66 | |
---|
| 67 | ``max_message_size`` |
---|
| 68 | This parameter is the maximum size in bytes of a message supported by the |
---|
| 69 | message queue. |
---|
| 70 | |
---|
| 71 | ``attribute_set`` |
---|
| 72 | This parameter is the attribute set of the message queue. |
---|
| 73 | |
---|
| 74 | ``id`` |
---|
[c70715b] | 75 | This parameter is the pointer to an :c:type:`rtems_id` object. When the |
---|
[63a9e0c] | 76 | directive call is successful, the identifier of the created message queue |
---|
[c70715b] | 77 | will be stored in this object. |
---|
[63a9e0c] | 78 | |
---|
| 79 | .. rubric:: DESCRIPTION: |
---|
| 80 | |
---|
| 81 | This directive creates a message queue which resides on the local node. The |
---|
| 82 | message queue has the user-defined object name specified in ``name``. Memory |
---|
| 83 | is allocated from the RTEMS Workspace for the count of messages specified in |
---|
| 84 | ``count``, each of ``max_message_size`` bytes in length. The assigned object |
---|
| 85 | identifier is returned in ``id``. This identifier is used to access the |
---|
| 86 | message queue with other message queue related directives. |
---|
| 87 | |
---|
| 88 | The **attribute set** specified in ``attribute_set`` is built through a |
---|
| 89 | *bitwise or* of the attribute constants described below. Not all combinations |
---|
| 90 | of attributes are allowed. Some attributes are mutually exclusive. If |
---|
| 91 | mutually exclusive attributes are combined, the behaviour is undefined. |
---|
| 92 | Attributes not mentioned below are not evaluated by this directive and have no |
---|
| 93 | effect. Default attributes can be selected by using the |
---|
| 94 | :c:macro:`RTEMS_DEFAULT_ATTRIBUTES` constant. The attribute set defines |
---|
| 95 | |
---|
| 96 | * the scope of the message queue: :c:macro:`RTEMS_LOCAL` (default) or |
---|
| 97 | :c:macro:`RTEMS_GLOBAL` and |
---|
| 98 | |
---|
| 99 | * the task wait queue discipline used by the message queue: |
---|
| 100 | :c:macro:`RTEMS_FIFO` (default) or :c:macro:`RTEMS_PRIORITY`. |
---|
| 101 | |
---|
| 102 | The message queue has a local or global **scope** in a multiprocessing network |
---|
| 103 | (this attribute does not refer to SMP systems). The scope is selected by the |
---|
| 104 | mutually exclusive :c:macro:`RTEMS_LOCAL` and :c:macro:`RTEMS_GLOBAL` |
---|
| 105 | attributes. |
---|
| 106 | |
---|
| 107 | * A **local scope** is the default and can be emphasized through the use of the |
---|
| 108 | :c:macro:`RTEMS_LOCAL` attribute. A local message queue can be only used by |
---|
| 109 | the node which created it. |
---|
| 110 | |
---|
| 111 | * A **global scope** is established if the :c:macro:`RTEMS_GLOBAL` attribute is |
---|
| 112 | set. Setting the global attribute in a single node system has no effect. |
---|
| 113 | |
---|
| 114 | The **task wait queue discipline** is selected by the mutually exclusive |
---|
| 115 | :c:macro:`RTEMS_FIFO` and :c:macro:`RTEMS_PRIORITY` attributes. The discipline |
---|
| 116 | defines the order in which tasks wait for a message to receive on a currently |
---|
| 117 | empty message queue. |
---|
| 118 | |
---|
| 119 | * The **FIFO discipline** is the default and can be emphasized through use of |
---|
| 120 | the :c:macro:`RTEMS_FIFO` attribute. |
---|
| 121 | |
---|
| 122 | * The **priority discipline** is selected by the :c:macro:`RTEMS_PRIORITY` |
---|
| 123 | attribute. |
---|
| 124 | |
---|
| 125 | .. rubric:: RETURN VALUES: |
---|
| 126 | |
---|
| 127 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 128 | The requested operation was successful. |
---|
| 129 | |
---|
| 130 | :c:macro:`RTEMS_INVALID_NAME` |
---|
| 131 | The ``name`` parameter was invalid. |
---|
| 132 | |
---|
| 133 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 134 | The ``id`` parameter was `NULL |
---|
| 135 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 136 | |
---|
| 137 | :c:macro:`RTEMS_INVALID_NUMBER` |
---|
| 138 | The ``count`` parameter was invalid. |
---|
| 139 | |
---|
| 140 | :c:macro:`RTEMS_INVALID_SIZE` |
---|
| 141 | The ``max_message_size`` parameter was invalid. |
---|
| 142 | |
---|
| 143 | :c:macro:`RTEMS_TOO_MANY` |
---|
| 144 | There was no inactive object available to create a message queue. The |
---|
| 145 | number of message queue available to the application is configured through |
---|
| 146 | the :ref:`CONFIGURE_MAXIMUM_MESSAGE_QUEUES` application configuration |
---|
| 147 | option. |
---|
| 148 | |
---|
| 149 | :c:macro:`RTEMS_TOO_MANY` |
---|
| 150 | In multiprocessing configurations, there was no inactive global object |
---|
| 151 | available to create a global message queue. The number of global objects |
---|
| 152 | available to the application is configured through the |
---|
| 153 | :ref:`CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS` application configuration |
---|
| 154 | option. |
---|
| 155 | |
---|
| 156 | :c:macro:`RTEMS_INVALID_NUMBER` |
---|
| 157 | The product of ``count`` and ``max_message_size`` is greater than the |
---|
| 158 | maximum storage size. |
---|
| 159 | |
---|
| 160 | :c:macro:`RTEMS_UNSATISFIED` |
---|
| 161 | There was not enough memory available in the RTEMS Workspace to allocate |
---|
| 162 | the message buffers for the message queue. |
---|
| 163 | |
---|
| 164 | .. rubric:: NOTES: |
---|
| 165 | |
---|
| 166 | For message queues with a global scope, the maximum message size is effectively |
---|
| 167 | limited to the longest message which the :term:`MPCI` is capable of |
---|
| 168 | transmitting. |
---|
| 169 | |
---|
| 170 | For control and maintenance of the message queue, RTEMS allocates a :term:`QCB` |
---|
| 171 | from the local QCB free pool and initializes it. |
---|
| 172 | |
---|
| 173 | The QCB for a global message queue is allocated on the local node. Message |
---|
| 174 | queues should not be made global unless remote tasks must interact with the |
---|
| 175 | message queue. This is to avoid the system overhead incurred by the creation |
---|
| 176 | of a global message queue. When a global message queue is created, the message |
---|
| 177 | queue's name and identifier must be transmitted to every node in the system for |
---|
| 178 | insertion in the local copy of the global object table. |
---|
| 179 | |
---|
| 180 | .. rubric:: CONSTRAINTS: |
---|
| 181 | |
---|
| 182 | The following constraints apply to this directive: |
---|
| 183 | |
---|
| 184 | * The directive may be called from within device driver initialization context. |
---|
| 185 | |
---|
| 186 | * The directive may be called from within task context. |
---|
| 187 | |
---|
| 188 | * The directive may obtain and release the object allocator mutex. This may |
---|
| 189 | cause the calling task to be preempted. |
---|
| 190 | |
---|
| 191 | * When the directive operates on a global object, the directive sends a message |
---|
| 192 | to remote nodes. This may preempt the calling task. |
---|
| 193 | |
---|
| 194 | * The number of message queues available to the application is configured |
---|
| 195 | through the :ref:`CONFIGURE_MAXIMUM_MESSAGE_QUEUES` application configuration |
---|
| 196 | option. |
---|
| 197 | |
---|
| 198 | * Where the object class corresponding to the directive is configured to use |
---|
| 199 | unlimited objects, the directive may allocate memory from the RTEMS |
---|
| 200 | Workspace. |
---|
| 201 | |
---|
| 202 | * The number of global objects available to the application is configured |
---|
| 203 | through the :ref:`CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS` application |
---|
| 204 | configuration option. |
---|
| 205 | |
---|
| 206 | .. Generated from spec:/rtems/message/if/construct |
---|
[53bb72e] | 207 | |
---|
| 208 | .. raw:: latex |
---|
| 209 | |
---|
[63a9e0c] | 210 | \clearpage |
---|
| 211 | |
---|
| 212 | .. index:: rtems_message_queue_construct() |
---|
| 213 | |
---|
| 214 | .. _InterfaceRtemsMessageQueueConstruct: |
---|
| 215 | |
---|
| 216 | rtems_message_queue_construct() |
---|
| 217 | ------------------------------- |
---|
| 218 | |
---|
| 219 | Constructs a message queue from the specified the message queue configuration. |
---|
| 220 | |
---|
| 221 | .. rubric:: CALLING SEQUENCE: |
---|
| 222 | |
---|
| 223 | .. code-block:: c |
---|
| 224 | |
---|
| 225 | rtems_status_code rtems_message_queue_construct( |
---|
| 226 | const rtems_message_queue_config *config, |
---|
| 227 | rtems_id *id |
---|
| 228 | ); |
---|
| 229 | |
---|
| 230 | .. rubric:: PARAMETERS: |
---|
| 231 | |
---|
| 232 | ``config`` |
---|
| 233 | This parameter is the message queue configuration. |
---|
| 234 | |
---|
| 235 | ``id`` |
---|
[c70715b] | 236 | This parameter is the pointer to an :c:type:`rtems_id` object. When the |
---|
[63a9e0c] | 237 | directive call is successful, the identifier of the constructed message |
---|
[c70715b] | 238 | queue will be stored in this object. |
---|
[63a9e0c] | 239 | |
---|
| 240 | .. rubric:: RETURN VALUES: |
---|
| 241 | |
---|
| 242 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 243 | The requested operation was successful. |
---|
| 244 | |
---|
| 245 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 246 | The ``config`` parameter was `NULL |
---|
| 247 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 248 | |
---|
| 249 | :c:macro:`RTEMS_INVALID_NAME` |
---|
| 250 | The message queue name in the configuration was invalid. |
---|
| 251 | |
---|
| 252 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 253 | The ``id`` parameter was `NULL |
---|
| 254 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 255 | |
---|
| 256 | :c:macro:`RTEMS_INVALID_NUMBER` |
---|
| 257 | The maximum number of pending messages in the configuration was zero. |
---|
| 258 | |
---|
| 259 | :c:macro:`RTEMS_INVALID_SIZE` |
---|
| 260 | The maximum message size in the configuration was zero. |
---|
| 261 | |
---|
| 262 | :c:macro:`RTEMS_TOO_MANY` |
---|
| 263 | There was no inactive message queue object available to construct a message |
---|
| 264 | queue. |
---|
| 265 | |
---|
| 266 | :c:macro:`RTEMS_TOO_MANY` |
---|
| 267 | In multiprocessing configurations, there was no inactive global object |
---|
| 268 | available to construct a global message queue. |
---|
| 269 | |
---|
| 270 | :c:macro:`RTEMS_INVALID_SIZE` |
---|
| 271 | The maximum message size in the configuration was too big and resulted in |
---|
| 272 | integer overflows in calculations carried out to determine the size of the |
---|
| 273 | message buffer area. |
---|
| 274 | |
---|
| 275 | :c:macro:`RTEMS_INVALID_NUMBER` |
---|
| 276 | The maximum number of pending messages in the configuration was too big and |
---|
| 277 | resulted in integer overflows in calculations carried out to determine the |
---|
| 278 | size of the message buffer area. |
---|
[fd6dc8c8] | 279 | |
---|
[63a9e0c] | 280 | :c:macro:`RTEMS_UNSATISFIED` |
---|
| 281 | The message queue storage area begin pointer in the configuration was `NULL |
---|
| 282 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
[fd6dc8c8] | 283 | |
---|
[63a9e0c] | 284 | :c:macro:`RTEMS_UNSATISFIED` |
---|
| 285 | The message queue storage area size in the configuration was not equal to |
---|
| 286 | the size calculated from the maximum number of pending messages and the |
---|
| 287 | maximum message size. |
---|
[3384994] | 288 | |
---|
[63a9e0c] | 289 | .. rubric:: NOTES: |
---|
[fd6dc8c8] | 290 | |
---|
[63a9e0c] | 291 | In contrast to message queues created by |
---|
| 292 | :ref:`InterfaceRtemsMessageQueueCreate`, the message queues constructed by this |
---|
| 293 | directive use a user-provided message buffer storage area. |
---|
[fd6dc8c8] | 294 | |
---|
[63a9e0c] | 295 | This directive is intended for applications which do not want to use the RTEMS |
---|
| 296 | Workspace and instead statically allocate all operating system resources. An |
---|
| 297 | application based solely on static allocation can avoid any runtime memory |
---|
| 298 | allocators. This can simplify the application architecture as well as any |
---|
| 299 | analysis that may be required. |
---|
[fd6dc8c8] | 300 | |
---|
[63a9e0c] | 301 | The value for :ref:`CONFIGURE_MESSAGE_BUFFER_MEMORY` should not include memory |
---|
| 302 | for message queues constructed by :ref:`InterfaceRtemsMessageQueueConstruct`. |
---|
[fd6dc8c8] | 303 | |
---|
[63a9e0c] | 304 | .. rubric:: CONSTRAINTS: |
---|
[8ef6ea8] | 305 | |
---|
[63a9e0c] | 306 | The following constraints apply to this directive: |
---|
[fd6dc8c8] | 307 | |
---|
[63a9e0c] | 308 | * The directive may be called from within device driver initialization context. |
---|
[fd6dc8c8] | 309 | |
---|
[63a9e0c] | 310 | * The directive may be called from within task context. |
---|
[fd6dc8c8] | 311 | |
---|
[63a9e0c] | 312 | * The directive may obtain and release the object allocator mutex. This may |
---|
| 313 | cause the calling task to be preempted. |
---|
[fd6dc8c8] | 314 | |
---|
[63a9e0c] | 315 | * When the directive operates on a global object, the directive sends a message |
---|
| 316 | to remote nodes. This may preempt the calling task. |
---|
| 317 | |
---|
| 318 | * The number of message queues available to the application is configured |
---|
| 319 | through the :ref:`CONFIGURE_MAXIMUM_MESSAGE_QUEUES` application configuration |
---|
| 320 | option. |
---|
| 321 | |
---|
| 322 | * Where the object class corresponding to the directive is configured to use |
---|
| 323 | unlimited objects, the directive may allocate memory from the RTEMS |
---|
| 324 | Workspace. |
---|
| 325 | |
---|
| 326 | * The number of global objects available to the application is configured |
---|
| 327 | through the :ref:`CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS` application |
---|
| 328 | configuration option. |
---|
| 329 | |
---|
| 330 | .. Generated from spec:/rtems/message/if/ident |
---|
| 331 | |
---|
| 332 | .. raw:: latex |
---|
| 333 | |
---|
| 334 | \clearpage |
---|
| 335 | |
---|
| 336 | .. index:: rtems_message_queue_ident() |
---|
| 337 | |
---|
| 338 | .. _InterfaceRtemsMessageQueueIdent: |
---|
| 339 | |
---|
| 340 | rtems_message_queue_ident() |
---|
| 341 | --------------------------- |
---|
| 342 | |
---|
| 343 | Identifies a message queue by the object name. |
---|
| 344 | |
---|
| 345 | .. rubric:: CALLING SEQUENCE: |
---|
| 346 | |
---|
| 347 | .. code-block:: c |
---|
| 348 | |
---|
| 349 | rtems_status_code rtems_message_queue_ident( |
---|
| 350 | rtems_name name, |
---|
| 351 | uint32_t node, |
---|
| 352 | rtems_id *id |
---|
| 353 | ); |
---|
| 354 | |
---|
| 355 | .. rubric:: PARAMETERS: |
---|
| 356 | |
---|
| 357 | ``name`` |
---|
| 358 | This parameter is the object name to look up. |
---|
| 359 | |
---|
| 360 | ``node`` |
---|
| 361 | This parameter is the node or node set to search for a matching object. |
---|
| 362 | |
---|
| 363 | ``id`` |
---|
[c70715b] | 364 | This parameter is the pointer to an :c:type:`rtems_id` object. When the |
---|
[63a9e0c] | 365 | directive call is successful, the object identifier of an object with the |
---|
[c70715b] | 366 | specified name will be stored in this object. |
---|
[63a9e0c] | 367 | |
---|
| 368 | .. rubric:: DESCRIPTION: |
---|
| 369 | |
---|
| 370 | This directive obtains a message queue identifier associated with the message |
---|
| 371 | queue name specified in ``name``. |
---|
| 372 | |
---|
| 373 | The node to search is specified in ``node``. It shall be |
---|
| 374 | |
---|
| 375 | * a valid node number, |
---|
| 376 | |
---|
| 377 | * the constant :c:macro:`RTEMS_SEARCH_ALL_NODES` to search in all nodes, |
---|
| 378 | |
---|
| 379 | * the constant :c:macro:`RTEMS_SEARCH_LOCAL_NODE` to search in the local node |
---|
| 380 | only, or |
---|
| 381 | |
---|
| 382 | * the constant :c:macro:`RTEMS_SEARCH_OTHER_NODES` to search in all nodes |
---|
| 383 | except the local node. |
---|
| 384 | |
---|
| 385 | .. rubric:: RETURN VALUES: |
---|
| 386 | |
---|
| 387 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 388 | The requested operation was successful. |
---|
| 389 | |
---|
| 390 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 391 | The ``id`` parameter was `NULL |
---|
| 392 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 393 | |
---|
| 394 | :c:macro:`RTEMS_INVALID_NAME` |
---|
| 395 | The ``name`` parameter was 0. |
---|
| 396 | |
---|
| 397 | :c:macro:`RTEMS_INVALID_NAME` |
---|
| 398 | There was no object with the specified name on the specified nodes. |
---|
| 399 | |
---|
| 400 | :c:macro:`RTEMS_INVALID_NODE` |
---|
| 401 | In multiprocessing configurations, the specified node was invalid. |
---|
| 402 | |
---|
| 403 | .. rubric:: NOTES: |
---|
| 404 | |
---|
| 405 | If the message queue name is not unique, then the message queue identifier will |
---|
| 406 | match the first message queue with that name in the search order. However, this |
---|
| 407 | message queue identifier is not guaranteed to correspond to the desired message |
---|
| 408 | queue. |
---|
| 409 | |
---|
| 410 | The objects are searched from lowest to the highest index. If ``node`` is |
---|
| 411 | :c:macro:`RTEMS_SEARCH_ALL_NODES`, all nodes are searched with the local node |
---|
| 412 | being searched first. All other nodes are searched from lowest to the highest |
---|
| 413 | node number. |
---|
| 414 | |
---|
| 415 | If node is a valid node number which does not represent the local node, then |
---|
| 416 | only the message queues exported by the designated node are searched. |
---|
| 417 | |
---|
| 418 | This directive does not generate activity on remote nodes. It accesses only |
---|
| 419 | the local copy of the global object table. |
---|
| 420 | |
---|
| 421 | The message queue identifier is used with other message related directives to |
---|
| 422 | access the message queue. |
---|
| 423 | |
---|
| 424 | .. rubric:: CONSTRAINTS: |
---|
| 425 | |
---|
| 426 | The following constraints apply to this directive: |
---|
| 427 | |
---|
| 428 | * The directive may be called from within any runtime context. |
---|
| 429 | |
---|
| 430 | * The directive will not cause the calling task to be preempted. |
---|
| 431 | |
---|
| 432 | .. Generated from spec:/rtems/message/if/delete |
---|
[fd6dc8c8] | 433 | |
---|
[53bb72e] | 434 | .. raw:: latex |
---|
[fd6dc8c8] | 435 | |
---|
[63a9e0c] | 436 | \clearpage |
---|
[8ef6ea8] | 437 | |
---|
[63a9e0c] | 438 | .. index:: rtems_message_queue_delete() |
---|
[6c56401] | 439 | .. index:: delete a message queue |
---|
[fd6dc8c8] | 440 | |
---|
[63a9e0c] | 441 | .. _InterfaceRtemsMessageQueueDelete: |
---|
| 442 | |
---|
| 443 | rtems_message_queue_delete() |
---|
| 444 | ---------------------------- |
---|
| 445 | |
---|
| 446 | Deletes the message queue. |
---|
| 447 | |
---|
| 448 | .. rubric:: CALLING SEQUENCE: |
---|
| 449 | |
---|
| 450 | .. code-block:: c |
---|
| 451 | |
---|
| 452 | rtems_status_code rtems_message_queue_delete( rtems_id id ); |
---|
| 453 | |
---|
| 454 | .. rubric:: PARAMETERS: |
---|
| 455 | |
---|
| 456 | ``id`` |
---|
| 457 | This parameter is the message queue identifier. |
---|
| 458 | |
---|
| 459 | .. rubric:: DESCRIPTION: |
---|
| 460 | |
---|
| 461 | This directive deletes the message queue specified by ``id``. As a result of |
---|
| 462 | this directive, all tasks blocked waiting to receive a message from this queue |
---|
| 463 | will be readied and returned a status code which indicates that the message |
---|
| 464 | queue was deleted. |
---|
| 465 | |
---|
| 466 | .. rubric:: RETURN VALUES: |
---|
| 467 | |
---|
| 468 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 469 | The requested operation was successful. |
---|
[3384994] | 470 | |
---|
[63a9e0c] | 471 | :c:macro:`RTEMS_INVALID_ID` |
---|
| 472 | There was no message queue associated with the identifier specified by |
---|
| 473 | ``id``. |
---|
[fd6dc8c8] | 474 | |
---|
[63a9e0c] | 475 | :c:macro:`RTEMS_ILLEGAL_ON_REMOTE_OBJECT` |
---|
| 476 | The message queue resided on a remote node. |
---|
[fd6dc8c8] | 477 | |
---|
[63a9e0c] | 478 | .. rubric:: NOTES: |
---|
[fd6dc8c8] | 479 | |
---|
[63a9e0c] | 480 | When the message queue is deleted, any messages in the queue are returned to |
---|
| 481 | the free message buffer pool. Any information stored in those messages is |
---|
| 482 | lost. The message buffers allocated for the message queue are reclaimed. |
---|
[8ef6ea8] | 483 | |
---|
[63a9e0c] | 484 | The :term:`QCB` for the deleted message queue is reclaimed by RTEMS. |
---|
[fd6dc8c8] | 485 | |
---|
[63a9e0c] | 486 | When a global message queue is deleted, the message queue identifier must be |
---|
| 487 | transmitted to every node in the system for deletion from the local copy of the |
---|
| 488 | global object table. |
---|
[fd6dc8c8] | 489 | |
---|
[63a9e0c] | 490 | The message queue must reside on the local node, even if the message queue was |
---|
| 491 | created with the :c:macro:`RTEMS_GLOBAL` attribute. |
---|
[1f8301a] | 492 | |
---|
[63a9e0c] | 493 | Proxies, used to represent remote tasks, are reclaimed when the message queue |
---|
| 494 | is deleted. |
---|
[fd6dc8c8] | 495 | |
---|
[63a9e0c] | 496 | .. rubric:: CONSTRAINTS: |
---|
[fd6dc8c8] | 497 | |
---|
[63a9e0c] | 498 | The following constraints apply to this directive: |
---|
[fd6dc8c8] | 499 | |
---|
[63a9e0c] | 500 | * The directive may be called from within device driver initialization context. |
---|
[fd6dc8c8] | 501 | |
---|
[63a9e0c] | 502 | * The directive may be called from within task context. |
---|
| 503 | |
---|
| 504 | * The directive may obtain and release the object allocator mutex. This may |
---|
| 505 | cause the calling task to be preempted. |
---|
| 506 | |
---|
| 507 | * When the directive operates on a global object, the directive sends a message |
---|
| 508 | to remote nodes. This may preempt the calling task. |
---|
| 509 | |
---|
| 510 | * The calling task does not have to be the task that created the object. Any |
---|
| 511 | local task that knows the object identifier can delete the object. |
---|
| 512 | |
---|
| 513 | * Where the object class corresponding to the directive is configured to use |
---|
| 514 | unlimited objects, the directive may free memory to the RTEMS Workspace. |
---|
| 515 | |
---|
| 516 | .. Generated from spec:/rtems/message/if/send |
---|
[fd6dc8c8] | 517 | |
---|
[53bb72e] | 518 | .. raw:: latex |
---|
[fd6dc8c8] | 519 | |
---|
[63a9e0c] | 520 | \clearpage |
---|
[8ef6ea8] | 521 | |
---|
[63a9e0c] | 522 | .. index:: rtems_message_queue_send() |
---|
[6c56401] | 523 | .. index:: send message to a queue |
---|
[63a9e0c] | 524 | |
---|
| 525 | .. _InterfaceRtemsMessageQueueSend: |
---|
| 526 | |
---|
| 527 | rtems_message_queue_send() |
---|
| 528 | -------------------------- |
---|
| 529 | |
---|
| 530 | Puts the message at the rear of the queue. |
---|
| 531 | |
---|
| 532 | .. rubric:: CALLING SEQUENCE: |
---|
| 533 | |
---|
| 534 | .. code-block:: c |
---|
| 535 | |
---|
| 536 | rtems_status_code rtems_message_queue_send( |
---|
| 537 | rtems_id id, |
---|
| 538 | const void *buffer, |
---|
| 539 | size_t size |
---|
| 540 | ); |
---|
| 541 | |
---|
| 542 | .. rubric:: PARAMETERS: |
---|
| 543 | |
---|
| 544 | ``id`` |
---|
| 545 | This parameter is the queue identifier. |
---|
| 546 | |
---|
| 547 | ``buffer`` |
---|
| 548 | This parameter is the begin address of the message buffer to send. |
---|
| 549 | |
---|
| 550 | ``size`` |
---|
| 551 | This parameter is the size in bytes of the message buffer to send. |
---|
| 552 | |
---|
| 553 | .. rubric:: DESCRIPTION: |
---|
| 554 | |
---|
| 555 | This directive sends the message ``buffer`` of ``size`` bytes in length to the |
---|
| 556 | queue specified by ``id``. If a task is waiting at the queue, then the message |
---|
| 557 | is copied to the waiting task's buffer and the task is unblocked. If no tasks |
---|
| 558 | are waiting at the queue, then the message is copied to a message buffer which |
---|
| 559 | is obtained from this message queue's message buffer pool. The message buffer |
---|
| 560 | is then placed at the rear of the queue. |
---|
| 561 | |
---|
| 562 | .. rubric:: RETURN VALUES: |
---|
| 563 | |
---|
| 564 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 565 | The requested operation was successful. |
---|
| 566 | |
---|
| 567 | :c:macro:`RTEMS_INVALID_ID` |
---|
| 568 | There was no queue associated with the identifier specified by ``id``. |
---|
| 569 | |
---|
| 570 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 571 | The ``buffer`` parameter was `NULL |
---|
| 572 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 573 | |
---|
| 574 | :c:macro:`RTEMS_INVALID_SIZE` |
---|
| 575 | The size of the message exceeded the maximum message size of the queue as |
---|
| 576 | defined by :ref:`InterfaceRtemsMessageQueueCreate` or |
---|
| 577 | :ref:`InterfaceRtemsMessageQueueConstruct`. |
---|
| 578 | |
---|
| 579 | :c:macro:`RTEMS_TOO_MANY` |
---|
| 580 | The maximum number of pending messages supported by the queue as defined by |
---|
| 581 | :ref:`InterfaceRtemsMessageQueueCreate` or |
---|
| 582 | :ref:`InterfaceRtemsMessageQueueConstruct` has been reached. |
---|
| 583 | |
---|
| 584 | .. rubric:: CONSTRAINTS: |
---|
| 585 | |
---|
| 586 | The following constraints apply to this directive: |
---|
| 587 | |
---|
| 588 | * The directive may be called from within task context. |
---|
| 589 | |
---|
| 590 | * The directive may be called from within interrupt context. |
---|
| 591 | |
---|
[ad16b37] | 592 | * The directive may unblock a task. This may cause the calling task to be |
---|
| 593 | preempted. |
---|
[63a9e0c] | 594 | |
---|
| 595 | * When the directive operates on a remote object, the directive sends a message |
---|
| 596 | to the remote node and waits for a reply. This will preempt the calling |
---|
| 597 | task. |
---|
| 598 | |
---|
| 599 | .. Generated from spec:/rtems/message/if/urgent |
---|
[53bb72e] | 600 | |
---|
| 601 | .. raw:: latex |
---|
| 602 | |
---|
[63a9e0c] | 603 | \clearpage |
---|
[8ef6ea8] | 604 | |
---|
[63a9e0c] | 605 | .. index:: rtems_message_queue_urgent() |
---|
[6c56401] | 606 | .. index:: put message at front of queue |
---|
[63a9e0c] | 607 | |
---|
| 608 | .. _InterfaceRtemsMessageQueueUrgent: |
---|
| 609 | |
---|
| 610 | rtems_message_queue_urgent() |
---|
| 611 | ---------------------------- |
---|
| 612 | |
---|
| 613 | Puts the message at the front of the queue. |
---|
| 614 | |
---|
| 615 | .. rubric:: CALLING SEQUENCE: |
---|
| 616 | |
---|
| 617 | .. code-block:: c |
---|
| 618 | |
---|
| 619 | rtems_status_code rtems_message_queue_urgent( |
---|
| 620 | rtems_id id, |
---|
| 621 | const void *buffer, |
---|
| 622 | size_t size |
---|
| 623 | ); |
---|
| 624 | |
---|
| 625 | .. rubric:: PARAMETERS: |
---|
| 626 | |
---|
| 627 | ``id`` |
---|
| 628 | This parameter is the queue identifier. |
---|
| 629 | |
---|
| 630 | ``buffer`` |
---|
| 631 | This parameter is the begin address of the message buffer to send urgently. |
---|
| 632 | |
---|
| 633 | ``size`` |
---|
| 634 | This parameter is the size in bytes of the message buffer to send urgently. |
---|
| 635 | |
---|
| 636 | .. rubric:: DESCRIPTION: |
---|
| 637 | |
---|
| 638 | This directive sends the message ``buffer`` of ``size`` bytes in length to the |
---|
| 639 | queue specified by ``id``. If a task is waiting at the queue, then the message |
---|
| 640 | is copied to the waiting task's buffer and the task is unblocked. If no tasks |
---|
| 641 | are waiting at the queue, then the message is copied to a message buffer which |
---|
| 642 | is obtained from this message queue's message buffer pool. The message buffer |
---|
| 643 | is then placed at the front of the queue. |
---|
| 644 | |
---|
| 645 | .. rubric:: RETURN VALUES: |
---|
| 646 | |
---|
| 647 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 648 | The requested operation was successful. |
---|
| 649 | |
---|
| 650 | :c:macro:`RTEMS_INVALID_ID` |
---|
| 651 | There was no queue associated with the identifier specified by ``id``. |
---|
| 652 | |
---|
| 653 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 654 | The ``buffer`` parameter was `NULL |
---|
| 655 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 656 | |
---|
| 657 | :c:macro:`RTEMS_INVALID_SIZE` |
---|
| 658 | The size of the message exceeded the maximum message size of the queue as |
---|
| 659 | defined by :ref:`InterfaceRtemsMessageQueueCreate` or |
---|
| 660 | :ref:`InterfaceRtemsMessageQueueConstruct`. |
---|
| 661 | |
---|
| 662 | :c:macro:`RTEMS_TOO_MANY` |
---|
| 663 | The maximum number of pending messages supported by the queue as defined by |
---|
| 664 | :ref:`InterfaceRtemsMessageQueueCreate` or |
---|
| 665 | :ref:`InterfaceRtemsMessageQueueConstruct` has been reached. |
---|
| 666 | |
---|
| 667 | .. rubric:: CONSTRAINTS: |
---|
| 668 | |
---|
| 669 | The following constraints apply to this directive: |
---|
| 670 | |
---|
| 671 | * The directive may be called from within task context. |
---|
| 672 | |
---|
| 673 | * The directive may be called from within interrupt context. |
---|
| 674 | |
---|
[ad16b37] | 675 | * The directive may unblock a task. This may cause the calling task to be |
---|
| 676 | preempted. |
---|
[63a9e0c] | 677 | |
---|
| 678 | * When the directive operates on a remote object, the directive sends a message |
---|
| 679 | to the remote node and waits for a reply. This will preempt the calling |
---|
| 680 | task. |
---|
| 681 | |
---|
| 682 | .. Generated from spec:/rtems/message/if/broadcast |
---|
[53bb72e] | 683 | |
---|
| 684 | .. raw:: latex |
---|
| 685 | |
---|
[63a9e0c] | 686 | \clearpage |
---|
[8ef6ea8] | 687 | |
---|
[63a9e0c] | 688 | .. index:: rtems_message_queue_broadcast() |
---|
[6c56401] | 689 | .. index:: broadcast message to a queue |
---|
[63a9e0c] | 690 | |
---|
| 691 | .. _InterfaceRtemsMessageQueueBroadcast: |
---|
| 692 | |
---|
| 693 | rtems_message_queue_broadcast() |
---|
| 694 | ------------------------------- |
---|
| 695 | |
---|
| 696 | Broadcasts the messages to the tasks waiting at the queue. |
---|
| 697 | |
---|
| 698 | .. rubric:: CALLING SEQUENCE: |
---|
| 699 | |
---|
| 700 | .. code-block:: c |
---|
| 701 | |
---|
| 702 | rtems_status_code rtems_message_queue_broadcast( |
---|
| 703 | rtems_id id, |
---|
| 704 | const void *buffer, |
---|
| 705 | size_t size, |
---|
| 706 | uint32_t *count |
---|
| 707 | ); |
---|
| 708 | |
---|
| 709 | .. rubric:: PARAMETERS: |
---|
| 710 | |
---|
| 711 | ``id`` |
---|
| 712 | This parameter is the queue identifier. |
---|
| 713 | |
---|
| 714 | ``buffer`` |
---|
| 715 | This parameter is the begin address of the message buffer to broadcast. |
---|
| 716 | |
---|
| 717 | ``size`` |
---|
| 718 | This parameter is the size in bytes of the message buffer to broadcast. |
---|
| 719 | |
---|
| 720 | ``count`` |
---|
| 721 | This parameter is the pointer to an `uint32_t |
---|
[c70715b] | 722 | <https://en.cppreference.com/w/c/types/integer>`_ object. When the |
---|
[63a9e0c] | 723 | directive call is successful, the number of unblocked tasks will be stored |
---|
[c70715b] | 724 | in this object. |
---|
[63a9e0c] | 725 | |
---|
| 726 | .. rubric:: DESCRIPTION: |
---|
| 727 | |
---|
| 728 | This directive causes all tasks that are waiting at the queue specified by |
---|
| 729 | ``id`` to be unblocked and sent the message contained in ``buffer``. Before a |
---|
| 730 | task is unblocked, the message ``buffer`` of ``size`` byes in length is copied |
---|
| 731 | to that task's message buffer. The number of tasks that were unblocked is |
---|
| 732 | returned in ``count``. |
---|
| 733 | |
---|
| 734 | .. rubric:: RETURN VALUES: |
---|
| 735 | |
---|
| 736 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 737 | The requested operation was successful. |
---|
| 738 | |
---|
| 739 | :c:macro:`RTEMS_INVALID_ID` |
---|
| 740 | There was no queue associated with the identifier specified by ``id``. |
---|
| 741 | |
---|
| 742 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 743 | The ``buffer`` parameter was `NULL |
---|
| 744 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 745 | |
---|
| 746 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 747 | The ``count`` parameter was `NULL |
---|
| 748 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 749 | |
---|
| 750 | :c:macro:`RTEMS_INVALID_SIZE` |
---|
| 751 | The size of the message exceeded the maximum message size of the queue as |
---|
| 752 | defined by :ref:`InterfaceRtemsMessageQueueCreate` or |
---|
| 753 | :ref:`InterfaceRtemsMessageQueueConstruct`. |
---|
| 754 | |
---|
| 755 | .. rubric:: NOTES: |
---|
| 756 | |
---|
| 757 | The execution time of this directive is directly related to the number of tasks |
---|
| 758 | waiting on the message queue, although it is more efficient than the equivalent |
---|
| 759 | number of invocations of :ref:`InterfaceRtemsMessageQueueSend`. |
---|
| 760 | |
---|
| 761 | .. rubric:: CONSTRAINTS: |
---|
| 762 | |
---|
| 763 | The following constraints apply to this directive: |
---|
| 764 | |
---|
| 765 | * The directive may be called from within task context. |
---|
| 766 | |
---|
| 767 | * The directive may be called from within interrupt context. |
---|
| 768 | |
---|
[ad16b37] | 769 | * The directive may unblock a task. This may cause the calling task to be |
---|
| 770 | preempted. |
---|
[63a9e0c] | 771 | |
---|
| 772 | * When the directive operates on a remote object, the directive sends a message |
---|
| 773 | to the remote node and waits for a reply. This will preempt the calling |
---|
| 774 | task. |
---|
| 775 | |
---|
| 776 | .. Generated from spec:/rtems/message/if/receive |
---|
[53bb72e] | 777 | |
---|
| 778 | .. raw:: latex |
---|
| 779 | |
---|
[63a9e0c] | 780 | \clearpage |
---|
[fd6dc8c8] | 781 | |
---|
[63a9e0c] | 782 | .. index:: rtems_message_queue_receive() |
---|
[6c56401] | 783 | .. index:: receive message from a queue |
---|
[53bb72e] | 784 | |
---|
[63a9e0c] | 785 | .. _InterfaceRtemsMessageQueueReceive: |
---|
| 786 | |
---|
| 787 | rtems_message_queue_receive() |
---|
| 788 | ----------------------------- |
---|
| 789 | |
---|
| 790 | Receives a message from the queue. |
---|
| 791 | |
---|
| 792 | .. rubric:: CALLING SEQUENCE: |
---|
| 793 | |
---|
| 794 | .. code-block:: c |
---|
| 795 | |
---|
| 796 | rtems_status_code rtems_message_queue_receive( |
---|
| 797 | rtems_id id, |
---|
| 798 | void *buffer, |
---|
| 799 | size_t *size, |
---|
| 800 | rtems_option option_set, |
---|
| 801 | rtems_interval timeout |
---|
| 802 | ); |
---|
| 803 | |
---|
| 804 | .. rubric:: PARAMETERS: |
---|
| 805 | |
---|
| 806 | ``id`` |
---|
| 807 | This parameter is the queue identifier. |
---|
| 808 | |
---|
| 809 | ``buffer`` |
---|
| 810 | This parameter is the begin address of the buffer to receive the message. |
---|
| 811 | The buffer shall be large enough to receive a message of the maximum length |
---|
| 812 | of the queue as defined by :ref:`InterfaceRtemsMessageQueueCreate` or |
---|
| 813 | :ref:`InterfaceRtemsMessageQueueConstruct`. The ``size`` parameter cannot |
---|
| 814 | be used to specify the size of the buffer. |
---|
| 815 | |
---|
| 816 | ``size`` |
---|
| 817 | This parameter is the pointer to a `size_t |
---|
[c70715b] | 818 | <https://en.cppreference.com/w/c/types/size_t>`_ object. When the |
---|
[63a9e0c] | 819 | directive call is successful, the size in bytes of the received messages |
---|
[c70715b] | 820 | will be stored in this object. This parameter cannot be used to specify |
---|
[63a9e0c] | 821 | the size of the buffer. |
---|
| 822 | |
---|
| 823 | ``option_set`` |
---|
| 824 | This parameter is the option set. |
---|
| 825 | |
---|
| 826 | ``timeout`` |
---|
| 827 | This parameter is the timeout in :term:`clock ticks <clock tick>` if the |
---|
| 828 | :c:macro:`RTEMS_WAIT` option is set. Use :c:macro:`RTEMS_NO_TIMEOUT` to |
---|
| 829 | wait potentially forever. |
---|
| 830 | |
---|
| 831 | .. rubric:: DESCRIPTION: |
---|
| 832 | |
---|
| 833 | This directive receives a message from the queue specified by ``id``. |
---|
| 834 | |
---|
| 835 | The **option set** specified in ``option_set`` is built through a *bitwise or* |
---|
| 836 | of the option constants described below. Not all combinations of options are |
---|
| 837 | allowed. Some options are mutually exclusive. If mutually exclusive options |
---|
| 838 | are combined, the behaviour is undefined. Options not mentioned below are not |
---|
| 839 | evaluated by this directive and have no effect. Default options can be selected |
---|
| 840 | by using the :c:macro:`RTEMS_DEFAULT_OPTIONS` constant. |
---|
| 841 | |
---|
| 842 | The calling task can **wait** or **try to receive** a message from the queue |
---|
| 843 | according to the mutually exclusive :c:macro:`RTEMS_WAIT` and |
---|
| 844 | :c:macro:`RTEMS_NO_WAIT` options. |
---|
| 845 | |
---|
| 846 | * **Waiting to receive** a message from the queue is the default and can be |
---|
| 847 | emphasized through the use of the :c:macro:`RTEMS_WAIT` option. The |
---|
| 848 | ``timeout`` parameter defines how long the calling task is willing to wait. |
---|
| 849 | Use :c:macro:`RTEMS_NO_TIMEOUT` to wait potentially forever, otherwise set a |
---|
| 850 | timeout interval in clock ticks. |
---|
| 851 | |
---|
| 852 | * **Trying to receive** a message from the queue is selected by the |
---|
| 853 | :c:macro:`RTEMS_NO_WAIT` option. If this option is defined, then the |
---|
| 854 | ``timeout`` parameter is ignored. When a message from the queue cannot be |
---|
| 855 | immediately received, then the :c:macro:`RTEMS_UNSATISFIED` status is |
---|
| 856 | returned. |
---|
| 857 | |
---|
| 858 | With either :c:macro:`RTEMS_WAIT` or :c:macro:`RTEMS_NO_WAIT` if there is at |
---|
| 859 | least one message in the queue, then it is copied to the buffer, the size is |
---|
| 860 | set to return the length of the message in bytes, and this directive returns |
---|
| 861 | immediately with the :c:macro:`RTEMS_SUCCESSFUL` status code. The buffer has |
---|
| 862 | to be big enough to receive a message of the maximum length with respect to |
---|
| 863 | this message queue. |
---|
| 864 | |
---|
| 865 | If the calling task chooses to return immediately and the queue is empty, then |
---|
| 866 | the directive returns immediately with the :c:macro:`RTEMS_UNSATISFIED` status |
---|
[bc66c95] | 867 | code. If the calling task chooses to wait at the message queue and the queue |
---|
| 868 | is empty, then the calling task is placed on the message wait queue and |
---|
| 869 | blocked. If the queue was created with the :c:macro:`RTEMS_PRIORITY` option |
---|
| 870 | specified, then the calling task is inserted into the wait queue according to |
---|
| 871 | its priority. But, if the queue was created with the :c:macro:`RTEMS_FIFO` |
---|
| 872 | option specified, then the calling task is placed at the rear of the wait |
---|
| 873 | queue. |
---|
[63a9e0c] | 874 | |
---|
| 875 | .. rubric:: RETURN VALUES: |
---|
| 876 | |
---|
| 877 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 878 | The requested operation was successful. |
---|
| 879 | |
---|
| 880 | :c:macro:`RTEMS_INVALID_ID` |
---|
| 881 | There was no queue associated with the identifier specified by ``id``. |
---|
| 882 | |
---|
| 883 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 884 | The ``buffer`` parameter was `NULL |
---|
| 885 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 886 | |
---|
| 887 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 888 | The ``size`` parameter was `NULL |
---|
| 889 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 890 | |
---|
| 891 | :c:macro:`RTEMS_UNSATISFIED` |
---|
| 892 | The queue was empty. |
---|
| 893 | |
---|
| 894 | :c:macro:`RTEMS_TIMEOUT` |
---|
| 895 | The timeout happened while the calling task was waiting to receive a |
---|
| 896 | message |
---|
| 897 | |
---|
| 898 | :c:macro:`RTEMS_OBJECT_WAS_DELETED` |
---|
| 899 | The queue was deleted while the calling task was waiting to receive a |
---|
| 900 | message. |
---|
| 901 | |
---|
| 902 | .. rubric:: CONSTRAINTS: |
---|
| 903 | |
---|
| 904 | The following constraints apply to this directive: |
---|
| 905 | |
---|
| 906 | * When a local queue is accessed and the :c:macro:`RTEMS_NO_WAIT` option is |
---|
| 907 | set, the directive may be called from within interrupt context. |
---|
| 908 | |
---|
| 909 | * The directive may be called from within task context. |
---|
| 910 | |
---|
| 911 | * When the request cannot be immediately satisfied and the |
---|
| 912 | :c:macro:`RTEMS_WAIT` option is set, the calling task blocks at some point |
---|
| 913 | during the directive call. |
---|
| 914 | |
---|
| 915 | * The timeout functionality of the directive requires a :term:`clock tick`. |
---|
| 916 | |
---|
| 917 | * When the directive operates on a remote object, the directive sends a message |
---|
| 918 | to the remote node and waits for a reply. This will preempt the calling |
---|
| 919 | task. |
---|
| 920 | |
---|
| 921 | .. Generated from spec:/rtems/message/if/get-number-pending |
---|
[53bb72e] | 922 | |
---|
| 923 | .. raw:: latex |
---|
| 924 | |
---|
[63a9e0c] | 925 | \clearpage |
---|
[8ef6ea8] | 926 | |
---|
[63a9e0c] | 927 | .. index:: rtems_message_queue_get_number_pending() |
---|
[6c56401] | 928 | .. index:: get number of pending messages |
---|
[fd6dc8c8] | 929 | |
---|
[63a9e0c] | 930 | .. _InterfaceRtemsMessageQueueGetNumberPending: |
---|
| 931 | |
---|
| 932 | rtems_message_queue_get_number_pending() |
---|
| 933 | ---------------------------------------- |
---|
| 934 | |
---|
| 935 | Gets the number of messages pending on the queue. |
---|
| 936 | |
---|
| 937 | .. rubric:: CALLING SEQUENCE: |
---|
| 938 | |
---|
| 939 | .. code-block:: c |
---|
| 940 | |
---|
| 941 | rtems_status_code rtems_message_queue_get_number_pending( |
---|
| 942 | rtems_id id, |
---|
| 943 | uint32_t *count |
---|
| 944 | ); |
---|
[3384994] | 945 | |
---|
[63a9e0c] | 946 | .. rubric:: PARAMETERS: |
---|
[fd6dc8c8] | 947 | |
---|
[63a9e0c] | 948 | ``id`` |
---|
| 949 | This parameter is the queue identifier. |
---|
[fd6dc8c8] | 950 | |
---|
[63a9e0c] | 951 | ``count`` |
---|
| 952 | This parameter is the pointer to an `uint32_t |
---|
[c70715b] | 953 | <https://en.cppreference.com/w/c/types/integer>`_ object. When the |
---|
[63a9e0c] | 954 | directive call is successful, the number of pending messages will be stored |
---|
[c70715b] | 955 | in this object. |
---|
[fd6dc8c8] | 956 | |
---|
[63a9e0c] | 957 | .. rubric:: DESCRIPTION: |
---|
[8ef6ea8] | 958 | |
---|
[63a9e0c] | 959 | This directive returns the number of messages pending on the queue specified by |
---|
| 960 | ``id`` in ``count``. If no messages are present on the queue, count is set to |
---|
| 961 | zero. |
---|
[fd6dc8c8] | 962 | |
---|
[63a9e0c] | 963 | .. rubric:: RETURN VALUES: |
---|
[fd6dc8c8] | 964 | |
---|
[63a9e0c] | 965 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 966 | The requested operation was successful. |
---|
| 967 | |
---|
| 968 | :c:macro:`RTEMS_INVALID_ID` |
---|
| 969 | There was no queue associated with the identifier specified by ``id``. |
---|
| 970 | |
---|
| 971 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 972 | The ``count`` parameter was `NULL |
---|
| 973 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 974 | |
---|
| 975 | .. rubric:: CONSTRAINTS: |
---|
| 976 | |
---|
| 977 | The following constraints apply to this directive: |
---|
| 978 | |
---|
| 979 | * The directive may be called from within task context. |
---|
| 980 | |
---|
| 981 | * The directive may be called from within interrupt context. |
---|
| 982 | |
---|
| 983 | * When the directive operates on a remote object, the directive sends a message |
---|
| 984 | to the remote node and waits for a reply. This will preempt the calling |
---|
| 985 | task. |
---|
| 986 | |
---|
| 987 | .. Generated from spec:/rtems/message/if/flush |
---|
[fd6dc8c8] | 988 | |
---|
[53bb72e] | 989 | .. raw:: latex |
---|
[fd6dc8c8] | 990 | |
---|
[63a9e0c] | 991 | \clearpage |
---|
[8ef6ea8] | 992 | |
---|
[63a9e0c] | 993 | .. index:: rtems_message_queue_flush() |
---|
[6c56401] | 994 | .. index:: flush messages on a queue |
---|
[fd6dc8c8] | 995 | |
---|
[63a9e0c] | 996 | .. _InterfaceRtemsMessageQueueFlush: |
---|
| 997 | |
---|
| 998 | rtems_message_queue_flush() |
---|
| 999 | --------------------------- |
---|
| 1000 | |
---|
| 1001 | Flushes all messages on the queue. |
---|
| 1002 | |
---|
| 1003 | .. rubric:: CALLING SEQUENCE: |
---|
| 1004 | |
---|
| 1005 | .. code-block:: c |
---|
| 1006 | |
---|
| 1007 | rtems_status_code rtems_message_queue_flush( rtems_id id, uint32_t *count ); |
---|
| 1008 | |
---|
| 1009 | .. rubric:: PARAMETERS: |
---|
| 1010 | |
---|
| 1011 | ``id`` |
---|
| 1012 | This parameter is the queue identifier. |
---|
| 1013 | |
---|
| 1014 | ``count`` |
---|
| 1015 | This parameter is the pointer to an `uint32_t |
---|
[c70715b] | 1016 | <https://en.cppreference.com/w/c/types/integer>`_ object. When the |
---|
[63a9e0c] | 1017 | directive call is successful, the number of unblocked tasks will be stored |
---|
[c70715b] | 1018 | in this object. |
---|
[63a9e0c] | 1019 | |
---|
| 1020 | .. rubric:: DESCRIPTION: |
---|
| 1021 | |
---|
| 1022 | This directive removes all pending messages from the queue specified by ``id``. |
---|
| 1023 | The number of messages removed is returned in ``count``. If no messages are |
---|
| 1024 | present on the queue, count is set to zero. |
---|
| 1025 | |
---|
| 1026 | .. rubric:: RETURN VALUES: |
---|
| 1027 | |
---|
| 1028 | :c:macro:`RTEMS_SUCCESSFUL` |
---|
| 1029 | The requested operation was successful. |
---|
| 1030 | |
---|
| 1031 | :c:macro:`RTEMS_INVALID_ID` |
---|
| 1032 | There was no queue associated with the identifier specified by ``id``. |
---|
| 1033 | |
---|
| 1034 | :c:macro:`RTEMS_INVALID_ADDRESS` |
---|
| 1035 | The ``count`` parameter was `NULL |
---|
| 1036 | <https://en.cppreference.com/w/c/types/NULL>`_. |
---|
| 1037 | |
---|
[6198c49] | 1038 | .. rubric:: NOTES: |
---|
| 1039 | |
---|
| 1040 | The directive does not flush tasks waiting to receive a message from the |
---|
| 1041 | :term:`wait queue` of the message queue. |
---|
| 1042 | |
---|
[63a9e0c] | 1043 | .. rubric:: CONSTRAINTS: |
---|
| 1044 | |
---|
| 1045 | The following constraints apply to this directive: |
---|
| 1046 | |
---|
| 1047 | * The directive may be called from within interrupt context. |
---|
| 1048 | |
---|
[6198c49] | 1049 | * The directive may be called from within device driver initialization context. |
---|
| 1050 | |
---|
| 1051 | * The directive may be called from within task context. |
---|
| 1052 | |
---|
| 1053 | * The directive will not cause the calling task to be preempted. |
---|
[63a9e0c] | 1054 | |
---|
| 1055 | .. Generated from spec:/rtems/message/if/buffer |
---|
| 1056 | |
---|
| 1057 | .. raw:: latex |
---|
| 1058 | |
---|
| 1059 | \clearpage |
---|
| 1060 | |
---|
| 1061 | .. index:: RTEMS_MESSAGE_QUEUE_BUFFER() |
---|
| 1062 | |
---|
| 1063 | .. _InterfaceRTEMSMESSAGEQUEUEBUFFER: |
---|
| 1064 | |
---|
| 1065 | RTEMS_MESSAGE_QUEUE_BUFFER() |
---|
| 1066 | ---------------------------- |
---|
| 1067 | |
---|
| 1068 | Defines a structure which can be used as a message queue buffer for messages of |
---|
| 1069 | the specified maximum size. |
---|
[3384994] | 1070 | |
---|
[63a9e0c] | 1071 | .. rubric:: CALLING SEQUENCE: |
---|
[fd6dc8c8] | 1072 | |
---|
[63a9e0c] | 1073 | .. code-block:: c |
---|
[53bb72e] | 1074 | |
---|
[63a9e0c] | 1075 | #define RTEMS_MESSAGE_QUEUE_BUFFER( maximum_message_size ) |
---|
[53bb72e] | 1076 | |
---|
[63a9e0c] | 1077 | .. rubric:: PARAMETERS: |
---|
[53bb72e] | 1078 | |
---|
[63a9e0c] | 1079 | ``maximum_message_size`` |
---|
| 1080 | This parameter is the maximum message size in bytes. |
---|
[53bb72e] | 1081 | |
---|
[63a9e0c] | 1082 | .. rubric:: NOTES: |
---|
[53bb72e] | 1083 | |
---|
[63a9e0c] | 1084 | Use this macro to define the message buffer storage area for |
---|
| 1085 | :ref:`InterfaceRtemsMessageQueueConstruct`. |
---|