doc: kernel: usermode: correct prefixes in app memory section
Application shared memory API uses 'appmem_' prefix for its functions and macros. This commit updates the respective documentation to align with the API convention. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
ff5d942db8
commit
e9432c6e94
1 changed files with 16 additions and 16 deletions
|
@ -41,43 +41,43 @@ _app_dmem(id) and _app_bmem(id). The id is used as the partition name.
|
|||
The resulting section name can be seen in the linker.map as
|
||||
"data_smem_id" and "data_smem_idb".
|
||||
|
||||
To create a k_mem_partition, call the macro app_mem_partition(part0)
|
||||
To create a k_mem_partition, call the macro appmem_partition(part0)
|
||||
where "part0" is the name then used to refer to that partition.
|
||||
This macro only creates a function and necessary data structures for
|
||||
the later "initialization".
|
||||
|
||||
To create a memory domain for the partition, the macro app_mem_domain(dom0)
|
||||
To create a memory domain for the partition, the macro appmem_domain(dom0)
|
||||
is called where "dom0" is the name then used for the memory domain.
|
||||
To initialize the partition (effectively adding the partition
|
||||
to a linked list), init_part_part0() is called. This is followed
|
||||
by init_app_memory(), which walks all partitions in the linked
|
||||
to a linked list), appmem_init_part_part0() is called. This is followed
|
||||
by appmem_init_app_memory(), which walks all partitions in the linked
|
||||
list and calculates the sizes for each partition.
|
||||
|
||||
Once the partition is initialized, the domain can be
|
||||
initialized with init_domain_dom0(part0) which initializes the
|
||||
initialized with appmem_init_domain_dom0(part0) which initializes the
|
||||
domain with partition part0.
|
||||
|
||||
After the domain has been initialized, the current thread
|
||||
can be added using add_thread_dom0(k_current_get()).
|
||||
can be added using appmem_add_thread_dom0(k_current_get()).
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
/* create partition at top of file outside functions */
|
||||
app_mem_partition(part0);
|
||||
appmem_partition(part0);
|
||||
/* create domain */
|
||||
app_mem_domain(dom0);
|
||||
appmem_domain(dom0);
|
||||
/* assign variables to the domain */
|
||||
_app_dmem(dom0) int var1;
|
||||
_app_bmem(dom0) static volatile int var2;
|
||||
|
||||
int main()
|
||||
{
|
||||
init_part_part0();
|
||||
init_app_memory();
|
||||
init_domain_dom0(part0);
|
||||
add_thread_dom0(k_current_get());
|
||||
appmem_init_part_part0();
|
||||
appmem_init_app_memory();
|
||||
appmem_init_domain_dom0(part0);
|
||||
appmem_add_thread_dom0(k_current_get());
|
||||
...
|
||||
}
|
||||
|
||||
|
@ -87,18 +87,18 @@ app_macro_support.h:
|
|||
|
||||
.. code-block:: c
|
||||
|
||||
FOR_EACH(app_mem_partition, part0, part1, part2);
|
||||
FOR_EACH(appmem_partition, part0, part1, part2);
|
||||
|
||||
or, for multiple domains, similarly:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
FOR_EACH(app_mem_domain, dom0, dom1);
|
||||
FOR_EACH(appmem_domain, dom0, dom1);
|
||||
|
||||
Similarly, the init_part_* can also be used in the macro:
|
||||
Similarly, the appmem_init_part_* can also be used in the macro:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
FOR_EACH(init_part, part0, part1, part2);
|
||||
FOR_EACH(appmem_init_part, part0, part1, part2);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue