[RTEMS Project] #3959: Add rtems_task_create_from_config()

RTEMS trac trac at rtems.org
Sun Sep 13 23:03:33 UTC 2020

#3959: Add rtems_task_create_from_config()
 Reporter:  Sebastian Huber  |       Owner:  Sebastian Huber
     Type:  enhancement      |      Status:  assigned
 Priority:  normal           |   Milestone:  6.1
Component:  rtems            |     Version:  6
 Severity:  normal           |  Resolution:
 Keywords:                   |  Blocked By:
 Blocking:                   |

Comment (by Chris Johns):

 The following are some suggested updates. It is hard to comment on stuff
 in the ticket header in a way that does not change it so I hope doing this
 is OK?

 Updated ....

  * @brief This structure defines a task configuration used to create
  *        a task with user provided storage.
  *   This structure defines the configuration of a task created by
  *   rtems_task_create_from_config().

 With this ...

    * There are no alignment requirements for the task storage area.  To
    * memory waste, use the #RTEMS_TASK_STORAGE_ALIGNMENT variable
 attribute to
    * enforce the recommended alignment of the task storage area.

 ... I understand the alignment for a user is anything but internally the
 memory may be aligned and that will potentially create some waste. For
 example I could provide `0x1` as an address but the stack base or the
 start of the TLS may need to be aligned depending on the arch,
 `_TLS_Alignment`, or something. Does this need to be explained?

 Updated ...

    * It is called when the task creation aborts due to a failed task
    * extension or the task is deleted.  It is called from task context
    * protection of the object allocator lock.  It is allowed to call
 free() in
    * this handler.  The handler may be NULL to disable.

 Updated ...

  * @brief Creates a task from the specified the task configuration.
  * In contrast to tasks created by rtems_task_create(), the tasks created
  * this directive use a user-provided task storage area.  The task storage
  * contains the task stack, the thread-local storage, and the floating-
  * context on architectures with a separate floating-point context.
  * It is recommended rtems_task_create() and
  * are not used together in an application. This means
  * rtems_task_create_from_config() is not recommended for drivers or
  * an application may use. This directive is intended for applications
  * do not want to use the RTEMS Workspace and instead statically allocate
  * operating system resources.
  * An application based solely on static allocation can avoid any runtime
  * memory allocators. This can simplfiy the application architecture as
  * as any analysis that may be required.
  * The stack space estimate done by <rtems/confdefs.h> assumes that all
  * are created by rtems_task_create().  The estimate can be adjusted to
  * user-provided task storage areas into account through the
  * #CONFIGURE_TASKS_CREATED_FROM_CONFIG application configuration option
 or a
  * custom task stack allocator, see #CONFIGURE_TASK_STACK_ALLOCATOR.
  * The #CONFIGURE_MAXIMUM_TASKS should includes tasks created with
  * rtems_task_create_from_config().


Ticket URL: <http://devel.rtems.org/ticket/3959#comment:10>
RTEMS Project <http://www.rtems.org/>
RTEMS Project

More information about the bugs mailing list