Zephyr API 3.6.99
|
Topics | |
Application memory domain APIs | |
Application memory domain APIs . | |
Data Structures | |
struct | k_mem_partition |
Memory Partition. More... | |
struct | k_mem_domain |
Memory Domain. More... | |
Macros | |
#define | K_MEM_PARTITION_DEFINE(name, start, size, attr) |
Statically declare a memory partition. | |
Functions | |
int | k_mem_domain_init (struct k_mem_domain *domain, uint8_t num_parts, struct k_mem_partition *parts[]) |
Initialize a memory domain. | |
int | k_mem_domain_add_partition (struct k_mem_domain *domain, struct k_mem_partition *part) |
Add a memory partition into a memory domain. | |
int | k_mem_domain_remove_partition (struct k_mem_domain *domain, struct k_mem_partition *part) |
Remove a memory partition from a memory domain. | |
int | k_mem_domain_add_thread (struct k_mem_domain *domain, k_tid_t thread) |
Add a thread into a memory domain. | |
Variables | |
struct k_mem_domain | k_mem_domain_default |
Default memory domain. | |
#define K_MEM_PARTITION_DEFINE | ( | name, | |
start, | |||
size, | |||
attr ) |
#include <zephyr/app_memory/mem_domain.h>
Statically declare a memory partition.
int k_mem_domain_add_partition | ( | struct k_mem_domain * | domain, |
struct k_mem_partition * | part ) |
#include <zephyr/app_memory/mem_domain.h>
Add a memory partition into a memory domain.
Add a memory partition into a memory domain. Partitions must conform to the following constraints:
Violating these constraints may lead to CPU exceptions or undefined behavior.
domain | The memory domain to be added a memory partition. |
part | The memory partition to be added |
0 | if successful |
-EINVAL | if invalid parameters supplied |
-ENOSPC | if no free partition slots available |
int k_mem_domain_add_thread | ( | struct k_mem_domain * | domain, |
k_tid_t | thread ) |
#include <zephyr/app_memory/mem_domain.h>
Add a thread into a memory domain.
Add a thread into a memory domain. It will be removed from whatever memory domain it previously belonged to.
domain | The memory domain that the thread is going to be added into. |
thread | ID of thread going to be added into the memory domain. |
int k_mem_domain_init | ( | struct k_mem_domain * | domain, |
uint8_t | num_parts, | ||
struct k_mem_partition * | parts[] ) |
#include <zephyr/app_memory/mem_domain.h>
Initialize a memory domain.
Initialize a memory domain with given name and memory partitions.
See documentation for k_mem_domain_add_partition() for details about partition constraints.
Do not call k_mem_domain_init() on the same memory domain more than once, doing so is undefined behavior.
domain | The memory domain to be initialized. |
num_parts | The number of array items of "parts" parameter. |
parts | An array of pointers to the memory partitions. Can be NULL if num_parts is zero. |
0 | if successful |
-EINVAL | if invalid parameters supplied |
-ENOMEM | if insufficient memory |
int k_mem_domain_remove_partition | ( | struct k_mem_domain * | domain, |
struct k_mem_partition * | part ) |
#include <zephyr/app_memory/mem_domain.h>
Remove a memory partition from a memory domain.
Remove a memory partition from a memory domain.
domain | The memory domain to be removed a memory partition. |
part | The memory partition to be removed |
0 | if successful |
-EINVAL | if invalid parameters supplied |
-ENOENT | if no matching partition found |
|
extern |
#include <zephyr/app_memory/mem_domain.h>
Default memory domain.
All threads are a member of some memory domain, even if running in supervisor mode. Threads belong to this default memory domain if they haven't been added to or inherited membership from some other domain.
This memory domain has the z_libc_partition partition for the C library added to it if exists.