aarch64: Move tpidr_el0 setup from spawn to switch

This commit is contained in:
Robin Randhawa
2021-01-17 10:09:03 +00:00
parent 67d72532a9
commit 67ec6c23e7
2 changed files with 5 additions and 1 deletions

View File

@@ -92,7 +92,6 @@ impl ContextList {
#[cfg(target_arch = "aarch64")]
{
let context_id = context.id.into();
context.arch.set_tcb(context_id);
context.arch.set_lr(func as usize);
context.arch.set_context_handle();
}

View File

@@ -151,6 +151,11 @@ pub unsafe fn switch() -> bool {
}
gdt::set_tcb((*to_ptr).id.into());
}
#[cfg(target_arch = "aarch64")]
{
let pid = (*to_ptr).id.into();
(*to_ptr).arch.set_tcb(pid);
}
CONTEXT_ID.store((*to_ptr).id, Ordering::SeqCst);
}