Commit ed938d18 authored by Andrew Boie's avatar Andrew Boie Committed by Anas Nashif
Browse files

arc: fix arch_ API implementations on current CPU



All of these should be no-ops for the following reasons:

1. User threads cannot configure memory domains, only supervisor
   threads.
2. The scope of memory domains is user thread memory access,
   supervisor threads can access the entire memory map.

Hence it's never required to reprogram the MPU on the current CPU
when a memory domain API is called.

This does not address the issue #27785 if a user thread in the domain
is running on some other CPU.

Signed-off-by: default avatarAndrew Boie <andrew.p.boie@intel.com>
parent 2222fa14
Loading
Loading
Loading
Loading
+4 −26
Original line number Diff line number Diff line
@@ -38,13 +38,7 @@ int arch_mem_domain_max_partitions_get(void)
void arch_mem_domain_partition_remove(struct k_mem_domain *domain,
				      uint32_t partition_id)
{
	if (_current->mem_domain_info.mem_domain != domain) {
		return;
	}

	arc_core_mpu_disable();
	arc_core_mpu_remove_mem_partition(domain, partition_id);
	arc_core_mpu_enable();
	/* No-op on this architecture */
}

/*
@@ -52,13 +46,7 @@ void arch_mem_domain_partition_remove(struct k_mem_domain *domain,
 */
void arch_mem_domain_thread_add(struct k_thread *thread)
{
	if (_current != thread) {
		return;
	}

	arc_core_mpu_disable();
	arc_core_mpu_configure_mem_domain(thread);
	arc_core_mpu_enable();
	/* No-op on this architecture */
}

/*
@@ -66,13 +54,7 @@ void arch_mem_domain_thread_add(struct k_thread *thread)
 */
void arch_mem_domain_destroy(struct k_mem_domain *domain)
{
	if (_current->mem_domain_info.mem_domain != domain) {
		return;
	}

	arc_core_mpu_disable();
	arc_core_mpu_remove_mem_domain(domain);
	arc_core_mpu_enable();
	/* No-op on this architecture */
}

void arch_mem_domain_partition_add(struct k_mem_domain *domain,
@@ -83,11 +65,7 @@ void arch_mem_domain_partition_add(struct k_mem_domain *domain,

void arch_mem_domain_thread_remove(struct k_thread *thread)
{
	if (_current != thread) {
		return;
	}

	arch_mem_domain_destroy(thread->mem_domain_info.mem_domain);
	/* No-op on this architecture */
}

/*