x86: MMU: Configure page tables entries for memory domain in swap.
During swap the required page tables are configured. The outgoing thread's memory domain pages are reset and the incoming thread's memory domain is loaded. The pages are configured if userspace is enabled and if memory domain has been initialized before calling swap. GH-3852 Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
parent
d0f6ce2d98
commit
a8b9353421
1 changed files with 10 additions and 1 deletions
|
@ -164,9 +164,18 @@ void _x86_swap_update_page_tables(struct k_thread *incoming,
|
|||
*/
|
||||
_main_tss.esp0 = incoming->stack_info.start;
|
||||
|
||||
/* TODO: if either thread defines different memory domains, efficiently
|
||||
/* If either thread defines different memory domains, efficiently
|
||||
* switch between them
|
||||
*/
|
||||
if (incoming->mem_domain_info.mem_domain !=
|
||||
outgoing->mem_domain_info.mem_domain){
|
||||
|
||||
/* Ensure that the outgoing mem domain configuration
|
||||
* is set back to default state.
|
||||
*/
|
||||
_arch_mem_domain_destroy(outgoing->mem_domain_info.mem_domain);
|
||||
_x86_load_mmu_mem_domain(incoming);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue