[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
avoid
* 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
create
* extension or the task is deleted. It is called from task context
under
* 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
by
* this directive use a user-provided task storage area. The task storage
area
* contains the task stack, the thread-local storage, and the floating-
point
* context on architectures with a separate floating-point context.
*
* It is recommended rtems_task_create() and
rtems_task_create_from_config()
* are not used together in an application. This means
* rtems_task_create_from_config() is not recommended for drivers or
libraries
* an application may use. This directive is intended for applications
which
* do not want to use the RTEMS Workspace and instead statically allocate
all
* operating system resources.
*
* An application based solely on static allocation can avoid any runtime
* memory allocators. This can simplfiy the application architecture as
well
* as any analysis that may be required.
*
* The stack space estimate done by <rtems/confdefs.h> assumes that all
tasks
* are created by rtems_task_create(). The estimate can be adjusted to
take
* 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