arch: riscv: pmp: reorder function definitions
Reorder the memory domain async functions to: arch_mem_domain_partition_add() arch_mem_domain_partition_remove() arch_mem_domain_thread_add() arch_mem_domain_thread_remove() Signed-off-by: Jim Shu <cwshu@andestech.com>
This commit is contained in:
parent
b13dd54fb4
commit
9683c9e71c
1 changed files with 25 additions and 25 deletions
|
@ -596,6 +596,31 @@ int arch_mem_domain_max_partitions_get(void)
|
||||||
return PMP_MAX_DYNAMIC_REGION;
|
return PMP_MAX_DYNAMIC_REGION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int arch_mem_domain_partition_add(struct k_mem_domain *domain,
|
||||||
|
uint32_t partition_id)
|
||||||
|
{
|
||||||
|
sys_dnode_t *node, *next_node;
|
||||||
|
struct k_thread *thread;
|
||||||
|
struct k_mem_partition *partition;
|
||||||
|
int ret = 0, ret2;
|
||||||
|
|
||||||
|
partition = &domain->partitions[partition_id];
|
||||||
|
|
||||||
|
SYS_DLIST_FOR_EACH_NODE_SAFE(&domain->mem_domain_q, node, next_node) {
|
||||||
|
thread = CONTAINER_OF(node, struct k_thread, mem_domain_info);
|
||||||
|
|
||||||
|
ret2 = z_riscv_pmp_add_dynamic(thread,
|
||||||
|
(ulong_t) partition->start,
|
||||||
|
(ulong_t) partition->size, partition->attr.pmp_attr);
|
||||||
|
ARG_UNUSED(ret2);
|
||||||
|
CHECKIF(ret2 != 0) {
|
||||||
|
ret = ret2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
|
int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
|
||||||
uint32_t partition_id)
|
uint32_t partition_id)
|
||||||
{
|
{
|
||||||
|
@ -717,31 +742,6 @@ int arch_mem_domain_thread_add(struct k_thread *thread)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int arch_mem_domain_partition_add(struct k_mem_domain *domain,
|
|
||||||
uint32_t partition_id)
|
|
||||||
{
|
|
||||||
sys_dnode_t *node, *next_node;
|
|
||||||
struct k_thread *thread;
|
|
||||||
struct k_mem_partition *partition;
|
|
||||||
int ret = 0, ret2;
|
|
||||||
|
|
||||||
partition = &domain->partitions[partition_id];
|
|
||||||
|
|
||||||
SYS_DLIST_FOR_EACH_NODE_SAFE(&domain->mem_domain_q, node, next_node) {
|
|
||||||
thread = CONTAINER_OF(node, struct k_thread, mem_domain_info);
|
|
||||||
|
|
||||||
ret2 = z_riscv_pmp_add_dynamic(thread,
|
|
||||||
(ulong_t) partition->start,
|
|
||||||
(ulong_t) partition->size, partition->attr.pmp_attr);
|
|
||||||
ARG_UNUSED(ret2);
|
|
||||||
CHECKIF(ret2 != 0) {
|
|
||||||
ret = ret2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int arch_mem_domain_thread_remove(struct k_thread *thread)
|
int arch_mem_domain_thread_remove(struct k_thread *thread)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue