kernel: mem_domain: Add to current thread should configure immediately.

when a current thread is added to a memory domain the pages/sections
must be configured immediately.
A problem occurs when we add a thread to current and then drop
down to usermode. In such a case memory domain will become active
the next time a swap occurs.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
Adithya Baglody 2017-12-06 16:48:28 +05:30 committed by Andrew Boie
commit 9cde20aefa
2 changed files with 6 additions and 9 deletions

View file

@ -158,6 +158,10 @@ void k_mem_domain_add_thread(struct k_mem_domain *domain, k_tid_t thread)
&thread->mem_domain_info.mem_domain_q_node);
thread->mem_domain_info.mem_domain = domain;
if (_current == thread) {
_arch_mem_domain_configure(thread);
}
irq_unlock(key);
}