[RTEMS Project] #4007: Add rtems_message_queue_construct() (was: Add rtems_message_queue_build())

RTEMS trac trac at rtems.org
Thu Sep 17 16:18:59 UTC 2020


#4007: Add rtems_message_queue_construct()
-----------------------------+------------------------------
 Reporter:  Sebastian Huber  |       Owner:  Sebastian Huber
     Type:  enhancement      |      Status:  accepted
 Priority:  normal           |   Milestone:  6.1
Component:  rtems            |     Version:  6
 Severity:  normal           |  Resolution:
 Keywords:                   |  Blocked By:
 Blocking:                   |
-----------------------------+------------------------------
Changes (by Sebastian Huber):

 * status:  assigned => accepted


Old description:

> In RTEMS 5 a lot of development was done to allow a static allocation of
> resources provided by RTEMS and avoid the use of a heap. Similar to #3959
> a new directive to build Classic API message queues without using the
> workspace is proposed:
> {{{
> /**
>  * @brief The message queue configuration to build a message queue.
>  */
> typedef struct {
>   /**
>    * @brief The name of the message queue.
>    */
>   rtems_name name;
>
>   /**
>    * @brief The count of the provided buffers.
>    *
>    * This value defines the maximum number of pending messages.
>    */
>   size_t buffer_count;
>
>   /**
>    * @brief The size of the provided buffers in bytes.
>    */
>   size_t buffer_size;
>
>   /**
>    * @brief The array of count message buffers.
>    *
>    * Each buffer shall have the size of the buffer_size member.  The
> maximum
>    * message size is buffer_size minus sizeof( rtems_message_queue_buffer
> ).
>    */
>   rtems_message_queue_buffer *buffers;
>
>   /**
>    * @brief The attribute set of the message queue.
>    */
>   rtems_attribute attribute_set;
> } rtems_message_queue_config;
>
> /**
>  * @brief Builds a message queue according to the specified
> configuration.
>  *
>  * @param config The message queue configuration.
>  * @param[out] id The message queue identifier of the new message queue.
>  *
>  * @retval RTEMS_SUCCESSFUL Successful operation.
>  * @retval RTEMS_INVALID_ADDRESS The id parameter is @c NULL.
>  * @retval RTEMS_INVALID_NAME The message queue name is invalid.
>  * @retval RTEMS_TOO_MANY No message queue is available.
>  */
> rtems_status_code rtems_message_queue_build(
>   const rtems_message_queue_config *config,
>   rtems_id                         *id
> );
> }}}

New description:

 In RTEMS 5 a lot of development was done to allow a static allocation of
 resources provided by RTEMS and avoid the use of a heap. Similar to #3959
 a new directive to build Classic API message queues without using the
 workspace is proposed:
 {{{
 /**
  * @brief The message queue configuration to construct a message queue.
  */
 typedef struct {
   /**
    * @brief The name of the message queue.
    */
   rtems_name name;

   /**
    * @brief The count of the provided buffers.
    *
    * This value defines the maximum number of pending messages.
    */
   size_t buffer_count;

   /**
    * @brief The size of the provided buffers in bytes.
    */
   size_t buffer_size;

   /**
    * @brief The array of count message buffers.
    *
    * Each buffer shall have the size of the buffer_size member.  The
 maximum
    * message size is buffer_size minus sizeof( rtems_message_queue_buffer
 ).
    */
   rtems_message_queue_buffer *buffers;

   /**
    * @brief The attribute set of the message queue.
    */
   rtems_attribute attribute_set;
 } rtems_message_queue_config;

 /**
  * @brief Constructs a message queue according to the specified
 configuration.
  *
  * @param config The message queue configuration.
  * @param[out] id The message queue identifier of the new message queue.
  *
  * @retval RTEMS_SUCCESSFUL Successful operation.
  * @retval RTEMS_INVALID_ADDRESS The id parameter is @c NULL.
  * @retval RTEMS_INVALID_NAME The message queue name is invalid.
  * @retval RTEMS_TOO_MANY No message queue is available.
  */
 rtems_status_code rtems_message_queue_construct(
   const rtems_message_queue_config *config,
   rtems_id                         *id
 );
 }}}

--

--
Ticket URL: <http://devel.rtems.org/ticket/4007#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list