kernel: Arch specific memory domain APIs added
Added arch specific calls to handle memory domain destroy and removal of partition. GH-3852 Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
parent
538fa7b37c
commit
eff2ec6ac9
|
@ -63,6 +63,11 @@ void k_mem_domain_destroy(struct k_mem_domain *domain)
|
||||||
|
|
||||||
key = irq_lock();
|
key = irq_lock();
|
||||||
|
|
||||||
|
/* Handle architecture specifc destroy only if it is the current thread*/
|
||||||
|
if (_current->mem_domain_info.mem_domain == domain) {
|
||||||
|
_arch_mem_domain_destroy(domain);
|
||||||
|
}
|
||||||
|
|
||||||
SYS_DLIST_FOR_EACH_NODE_SAFE(&domain->mem_domain_q, node, next_node) {
|
SYS_DLIST_FOR_EACH_NODE_SAFE(&domain->mem_domain_q, node, next_node) {
|
||||||
struct k_thread *thread =
|
struct k_thread *thread =
|
||||||
CONTAINER_OF(node, struct k_thread, mem_domain_info);
|
CONTAINER_OF(node, struct k_thread, mem_domain_info);
|
||||||
|
@ -127,6 +132,11 @@ void k_mem_domain_remove_partition(struct k_mem_domain *domain,
|
||||||
/* Assert if not found */
|
/* Assert if not found */
|
||||||
__ASSERT(p_idx < max_partitions, "");
|
__ASSERT(p_idx < max_partitions, "");
|
||||||
|
|
||||||
|
/* Handle architecture specifc remove only if it is the current thread*/
|
||||||
|
if (_current->mem_domain_info.mem_domain == domain) {
|
||||||
|
_arch_mem_domain_partition_remove(domain, p_idx);
|
||||||
|
}
|
||||||
|
|
||||||
domain->partitions[p_idx].start = 0;
|
domain->partitions[p_idx].start = 0;
|
||||||
domain->partitions[p_idx].size = 0;
|
domain->partitions[p_idx].size = 0;
|
||||||
domain->partitions[p_idx].attr = 0;
|
domain->partitions[p_idx].attr = 0;
|
||||||
|
|
Loading…
Reference in a new issue