diff --git a/arch/x86/core/x86_mmu.c b/arch/x86/core/x86_mmu.c index 351b4de00ff..a8b9f91facc 100644 --- a/arch/x86/core/x86_mmu.c +++ b/arch/x86/core/x86_mmu.c @@ -260,18 +260,11 @@ static inline void _x86_mem_domain_pages_update(struct k_mem_domain *mem_domain, return; } - -/* Load the required parttions of the new incoming thread */ -static inline void _x86_mmu_mem_domain_load(struct k_thread *thread) -{ - _x86_mem_domain_pages_update(thread->mem_domain_info.mem_domain, - X86_MEM_DOMAIN_SET_PAGES); -} - /* Load the partitions of the thread. */ void _arch_mem_domain_configure(struct k_thread *thread) { - _x86_mmu_mem_domain_load(thread); + _x86_mem_domain_pages_update(thread->mem_domain_info.mem_domain, + X86_MEM_DOMAIN_SET_PAGES); } /* Destroy or reset the mmu page tables when necessary. diff --git a/kernel/mem_domain.c b/kernel/mem_domain.c index 64db41e1954..c50e19e5c84 100644 --- a/kernel/mem_domain.c +++ b/kernel/mem_domain.c @@ -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); }